Interface SecurityService
- All Known Implementing Classes:
SecurityServiceImpl
public interface SecurityService
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.Authentication
Returns theAuthentication
for the current user or null if not user is authenticated.Returns the username of the current usergetUserPermission
(String siteId, String username, List<NormalizedRole> roles) Get user permissions for given siteboolean
isSiteMember
(String username, String siteName) Check if a user is a member of a site User is a member of a site if they are member of any site group.boolean
isSystemAdmin
(String username) Check if given user has system_admin role
-
Method Details
-
getUserPermission
List<String> getUserPermission(String siteId, String username, List<NormalizedRole> roles) throws ExecutionException Get user permissions for given site- Parameters:
siteId
- crafter site Idusername
- userroles
- roles the user is assigned to- Returns:
- list of user permissions
- Throws:
ExecutionException
-
getCurrentUser
String getCurrentUser()Returns the username of the current user- Returns:
- username of the current user, or null if no user is authenticated
-
getAuthentication
org.springframework.security.core.Authentication getAuthentication()Returns theAuthentication
for the current user or null if not user is authenticated.- Returns:
- authentication
-
isSiteMember
Check if a user is a member of a site User is a member of a site if they are member of any site group. A site group is any group mapped in the site's role mapping configuration file.- Parameters:
username
- the usernamesiteName
- the site name- Returns:
- true if user is a member of the site, false otherwise
-
isSystemAdmin
Check if given user has system_admin role- Parameters:
username
- user- Returns:
- true if user is system_admin, false otherwise
-