Interface SecurityService
- All Known Implementing Classes:
SecurityServiceImpl
public interface SecurityService
- Author:
- Dejan Brkic
-
Method Summary
Modifier and TypeMethodDescriptionint
Get all usersorg.springframework.security.core.Authentication
Deprecated.Deprecated.useSecurityService.getCurrentUser()
insteadgetUserGlobalRoles
(long userId, String username) getUserPermissions
(String site, String path, String user) getUserProfile
(String user) getUserProfileByGitName
(String gitName) Get user by git name.getUserRoles
(String site) getUserRoles
(String site, String user) getUserRoles
(String site, String user, boolean includeGlobal) boolean
isSiteAdmin
(String username, String site) Check if given user is site adminboolean
isSystemAdmin
(String username) Check if given user has system_admin roleboolean
userExists
(String username) Check if user exists
-
Method Details
-
getCurrentUser
Deprecated.useSecurityService.getCurrentUser()
insteadReturns the username of the current user OR NULL if no user is authenticated- Returns:
- current user
-
getAuthentication
Deprecated.useSecurityService.getAuthentication()
insteadReturns theAuthentication
for the current user or null if not user is authenticated.- Returns:
- authentication
-
getUserRoles
-
getUserRoles
-
getUserRoles
-
getUserProfile
-
getUserProfileByGitName
Map<String,Object> getUserProfileByGitName(String gitName) throws ServiceLayerException, UserNotFoundException Get user by git name. Special use case because git stores user as string of first and last name separated by ' '- Parameters:
gitName
- first and last name separated with ' '- Returns:
- user
- Throws:
ServiceLayerException
- general service errorUserNotFoundException
- user not found
-
getUserPermissions
-
userExists
Check if user exists- Parameters:
username
- username- Returns:
- true if user exists
- Throws:
ServiceLayerException
- general service error
-
getAllUsersTotal
Get all users- Returns:
- number of all users
- Throws:
ServiceLayerException
- general service error
-
isSiteAdmin
Check if given user is site admin- Parameters:
username
- usersite
- site identifier- Returns:
- true if user belongs to admin group
-
isSystemAdmin
Check if given user has system_admin role- Parameters:
username
- user- Returns:
- true if user is system_admin, false otherwise
-
getUserGlobalRoles
List<NormalizedRole> getUserGlobalRoles(long userId, String username) throws ServiceLayerException, UserNotFoundException
-
SecurityService.getAuthentication()
instead