Class SpringSecurityContextService
- java.lang.Object
-
- org.opennms.web.springframework.security.SpringSecurityContextService
-
- All Implemented Interfaces:
SecurityContextService
public class SpringSecurityContextService extends java.lang.Object implements SecurityContextService
-
-
Constructor Summary
Constructors Constructor Description SpringSecurityContextService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetPassword()Get the user password about the currently logged in userjava.lang.StringgetUsername()Get the user name about the currently logged in userbooleanhasRole(java.lang.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
public java.lang.String getUsername()
Description copied from interface:SecurityContextServiceGet the user name about the currently logged in user- Specified by:
getUsernamein interfaceSecurityContextService- Returns:
- user name from security context otherwise null
-
getPassword
public java.lang.String getPassword()
Description copied from interface:SecurityContextServiceGet the user password about the currently logged in user- Specified by:
getPasswordin interfaceSecurityContextService- Returns:
- user password from security context otherwise null
-
hasRole
public boolean hasRole(java.lang.String role)
Description copied from interface:SecurityContextServiceCheck if the currently logged in user has the required role.- Specified by:
hasRolein interfaceSecurityContextService- Parameters:
role- - required role- Returns:
- true if role is assigned, otherwise false
-
isAuthenticated
public boolean isAuthenticated()
Description copied from interface:SecurityContextServiceCheck if the currently logged in user is authenticated.- Specified by:
isAuthenticatedin interfaceSecurityContextService- Returns:
- true is authenticated, otherwise false
-
-