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.String
getPassword()
Get the user password about the currently logged in userjava.lang.String
getUsername()
Get the user name about the currently logged in userboolean
hasRole(java.lang.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
public java.lang.String getUsername()
Description copied from interface:SecurityContextService
Get the user name about the currently logged in user- Specified by:
getUsername
in interfaceSecurityContextService
- Returns:
- user name from security context otherwise null
-
getPassword
public java.lang.String getPassword()
Description copied from interface:SecurityContextService
Get the user password about the currently logged in user- Specified by:
getPassword
in interfaceSecurityContextService
- Returns:
- user password from security context otherwise null
-
hasRole
public boolean hasRole(java.lang.String role)
Description copied from interface:SecurityContextService
Check if the currently logged in user has the required role.- Specified by:
hasRole
in interfaceSecurityContextService
- Parameters:
role
- - required role- Returns:
- true if role is assigned, otherwise false
-
isAuthenticated
public boolean isAuthenticated()
Description copied from interface:SecurityContextService
Check if the currently logged in user is authenticated.- Specified by:
isAuthenticated
in interfaceSecurityContextService
- Returns:
- true is authenticated, otherwise false
-
-