Package mops.businesslogic.security
Interface SecurityService
-
- All Known Implementing Classes:
SecurityServiceImpl
@Service public interface SecurityServiceChecks roles permissions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcheckDeletePermission(Account account, Directory directory)Checks if the user has deleting rights.voidcheckIfRole(Account account, long groupId, java.lang.String allowedRole)Checks if user is has a role.voidcheckReadPermission(Account account, Directory directory)Checks if the user has reading rights.voidcheckWritePermission(Account account, Directory directory)Checks if the user has writing rights.UserPermissiongetPermissionsOfUser(Account account, Directory directory)Gets all 3 permissions of a user in a directory.java.lang.StringgetUserRole(long groupId, Account account)Get the role of a given user in a group.booleanisUserAdmin(Account account, long groupId)Checks if user is has the admin role.
-
-
-
Method Detail
-
getPermissionsOfUser
UserPermission getPermissionsOfUser(Account account, Directory directory) throws MopsException
Gets all 3 permissions of a user in a directory.- Parameters:
account- user credentialsdirectory- the directory- Returns:
- a permission flag object
- Throws:
MopsException
-
checkWritePermission
void checkWritePermission(Account account, Directory directory) throws MopsException
Checks if the user has writing rights.- Parameters:
account- user credentialsdirectory- id of the directory to check- Throws:
MopsException- checked exception to present to UI
-
checkReadPermission
void checkReadPermission(Account account, Directory directory) throws MopsException
Checks if the user has reading rights.- Parameters:
account- user credentialsdirectory- id of the directory to check- Throws:
MopsException- checked exception to present to UI
-
checkDeletePermission
void checkDeletePermission(Account account, Directory directory) throws MopsException
Checks if the user has deleting rights.- Parameters:
account- user credentialsdirectory- id of the directory to check- Throws:
MopsException- checked exception to present to UI
-
isUserAdmin
boolean isUserAdmin(Account account, long groupId) throws MopsException
Checks if user is has the admin role.- Parameters:
account- user credentialsgroupId- id of the group to check- Returns:
- true if admin
- Throws:
MopsException
-
checkIfRole
void checkIfRole(Account account, long groupId, java.lang.String allowedRole) throws MopsException
Checks if user is has a role.- Parameters:
account- user credentialsgroupId- id of the group to checkallowedRole- role which has the right- Throws:
MopsException- checked exception to present to UI
-
getUserRole
java.lang.String getUserRole(long groupId, Account account) throws MopsExceptionGet the role of a given user in a group.- Parameters:
groupId- group to checkaccount- given user- Returns:
- user role
- Throws:
MopsException
-
-