Package org.opennms.web.api
Interface SecurityContextService
-
- All Known Implementing Classes:
SpringSecurityContextService
public interface SecurityContextService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getPassword()
Get the user password about the currently logged in userString
getUsername()
Get the user name about the currently logged in userboolean
hasRole(String role)
Check if the currently logged in user has the required role.boolean
isAuthenticated()
Check if the currently logged in user is authenticated.
-
-
-
Method Detail
-
getUsername
String getUsername()
Get the user name about the currently logged in user- Returns:
- user name from security context otherwise null
-
getPassword
String getPassword()
Get the user password about the currently logged in user- Returns:
- user password from security context otherwise null
-
hasRole
boolean hasRole(String role)
Check if the currently logged in user has the required role.- Parameters:
role
- - required role- Returns:
- true if role is assigned, otherwise false
-
isAuthenticated
boolean isAuthenticated()
Check if the currently logged in user is authenticated.- Returns:
- true is authenticated, otherwise false
-
-