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 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
public 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 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(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
-
-