Class AccessLevelServiceImpl
java.lang.Object
ru.cg.webbpm.modules.security.api.impl.service.AccessLevelServiceImpl
- All Implemented Interfaces:
AccessLevelService
- Author:
- Kochetkov
-
Constructor Summary
ConstructorsConstructorDescriptionAccessLevelServiceImpl
(SecurityContext securityContext, AccessLevelDao accessLevelDao, UserGroupDao userGroupDao, GroupDao groupDao) Access level service constructor - creates new access level service. -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkGroupAccessLevel
(Collection<Group> groups) Checks the current user's access level to the collection of groups.void
checkGroupAccessLevel
(Collection<Group> groups, String userId) Checks the user's access level to the collection of groups.void
checkGroupsAccessLevelByIds
(Collection<String> groupIds) Checks the current user's access level to the collection of group ids.void
checkGroupsAccessLevelByIds
(Collection<String> groupIds, String userId) Checks user's access level to the the collection of groups ids.Gets access level by access level id.get
(LoadOptions options) Gets list of access levels which less than current user access level according to load options.short
Gets current user's maximal access level.short
getGroupsAccessLevel
(Collection<Group> groups) Gets maximal access level of groups.Gets maximal access level.Gets id of maximal access level.Gets minimal access level.Gets id of minimal access level.short
getUserAccessLevel
(String userId) Gets user's maximal access level by user id.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ru.cg.webbpm.modules.security.api.service.AccessLevelService
checkGroupAccessLevel, checkGroupAccessLevelById, checkGroupAccessLevelById
-
Constructor Details
-
AccessLevelServiceImpl
@Autowired public AccessLevelServiceImpl(SecurityContext securityContext, AccessLevelDao accessLevelDao, UserGroupDao userGroupDao, GroupDao groupDao) Access level service constructor - creates new access level service.- Parameters:
securityContext
- user's security context. Instance ofSecurityContext
type.accessLevelDao
- access level data access object. Instance ofAccessLevelDao
type.userGroupDao
- link user account user group data access object. Instance ofUserGroupDao
type.groupDao
- user group data access object. Instance ofGroupDao
type.
-
-
Method Details
-
get
Gets access level by access level id. Access level must be less than current user access level.- Specified by:
get
in interfaceAccessLevelService
- Parameters:
accessLevelId
- access level id. Instance ofString
type.- Returns:
- requested access level or null if does not exist. Instance of
AccessLevel
type. - Throws:
AccessDeniedException
- if current user access level is less than requested access level.- See Also:
-
get
Gets list of access levels which less than current user access level according to load options.- Specified by:
get
in interfaceAccessLevelService
- Parameters:
options
- indicates load option properties. Instance ofLoadOptions
type.- Returns:
- list of access levels. Instance of
List
type. - See Also:
-
getMinAccessLevelId
Gets id of minimal access level.- Specified by:
getMinAccessLevelId
in interfaceAccessLevelService
- Returns:
- id of minimal access level or null if does not exist. Instance of
String
type. - See Also:
-
getMaxAccessLevelId
Gets id of maximal access level.- Specified by:
getMaxAccessLevelId
in interfaceAccessLevelService
- Returns:
- id of maximal access level or null if does not exist. Instance of
String
type. - See Also:
-
getMinAccessLevel
Gets minimal access level.- Specified by:
getMinAccessLevel
in interfaceAccessLevelService
- Returns:
- minimal access level or null if does not exist. Instance of
AccessLevel
type. - See Also:
-
getMaxAccessLevel
Gets maximal access level.- Specified by:
getMaxAccessLevel
in interfaceAccessLevelService
- Returns:
- maximal access level or null if does not exist. Instance of
AccessLevel
type. - See Also:
-
getCurrentUserAccessLevel
public short getCurrentUserAccessLevel()Gets current user's maximal access level.- Specified by:
getCurrentUserAccessLevel
in interfaceAccessLevelService
- Returns:
- number value of maximal access level. Instance of
short
type. - See Also:
-
getUserAccessLevel
Gets user's maximal access level by user id.- Specified by:
getUserAccessLevel
in interfaceAccessLevelService
- Parameters:
userId
- user account id. Instance ofString
type.- Returns:
- number value of maximal access level or Short.MIN_VALUE. Instance of
short
type. - See Also:
-
getGroupsAccessLevel
Gets maximal access level of groups.- Specified by:
getGroupsAccessLevel
in interfaceAccessLevelService
- Parameters:
groups
- collection of groups. Instance ofCollection
type.- Returns:
- number value of maximal access level or Short.MIN_VALUE. Instance of
short
type.
-
checkGroupsAccessLevelByIds
Checks the current user's access level to the collection of group ids.- Specified by:
checkGroupsAccessLevelByIds
in interfaceAccessLevelService
- Parameters:
groupIds
- collection of group ids. Instance ofCollection
type.- See Also:
-
checkGroupsAccessLevelByIds
Checks user's access level to the the collection of groups ids.- Specified by:
checkGroupsAccessLevelByIds
in interfaceAccessLevelService
- Parameters:
groupIds
- collection group ids. Instance ofCollection
type.userId
- user account id. Instance ofString
type.- See Also:
-
checkGroupAccessLevel
Checks the current user's access level to the collection of groups.- Specified by:
checkGroupAccessLevel
in interfaceAccessLevelService
- Parameters:
groups
- collection of groups. Instance ofCollection
type.- See Also:
-
checkGroupAccessLevel
Checks the user's access level to the collection of groups.- Specified by:
checkGroupAccessLevel
in interfaceAccessLevelService
- Parameters:
groups
- collection of groups. Instance ofCollection
type.userId
- user's id. Instance ofString
type.- Throws:
AccessDeniedException
- if user access level is less than groups access level.- See Also:
-