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 StringgetPassword()Get the user password about the currently logged in userStringgetUsername()Get the user name about the currently logged in userbooleanhasRole(String role)Check if the currently logged in user has the required role.booleanisAuthenticated()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
-
-