Class SpringSecurityContextService
- java.lang.Object
-
- org.opennms.web.springframework.security.SpringSecurityContextService
-
- All Implemented Interfaces:
SecurityContextService
public class SpringSecurityContextService extends Object implements SecurityContextService
-
-
Constructor Summary
Constructors Constructor Description SpringSecurityContextService()
-
Method Summary
All Methods Instance Methods Concrete 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
public 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 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(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
-
-