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 TypeMethodDescriptionvoidcheckGroupAccessLevel(Collection<Group> groups) Checks the current user's access level to the collection of groups.voidcheckGroupAccessLevel(Collection<Group> groups, String userId) Checks the user's access level to the collection of groups.voidcheckGroupsAccessLevelByIds(Collection<String> groupIds) Checks the current user's access level to the collection of group ids.voidcheckGroupsAccessLevelByIds(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.shortGets current user's maximal access level.shortgetGroupsAccessLevel(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.shortgetUserAccessLevel(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, waitMethods 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 ofSecurityContexttype.accessLevelDao- access level data access object. Instance ofAccessLevelDaotype.userGroupDao- link user account user group data access object. Instance ofUserGroupDaotype.groupDao- user group data access object. Instance ofGroupDaotype.
-
-
Method Details
-
get
Gets access level by access level id. Access level must be less than current user access level.- Specified by:
getin interfaceAccessLevelService- Parameters:
accessLevelId- access level id. Instance ofStringtype.- Returns:
- requested access level or null if does not exist. Instance of
AccessLeveltype. - 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:
getin interfaceAccessLevelService- Parameters:
options- indicates load option properties. Instance ofLoadOptionstype.- Returns:
- list of access levels. Instance of
Listtype. - See Also:
-
getMinAccessLevelId
Gets id of minimal access level.- Specified by:
getMinAccessLevelIdin interfaceAccessLevelService- Returns:
- id of minimal access level or null if does not exist. Instance of
Stringtype. - See Also:
-
getMaxAccessLevelId
Gets id of maximal access level.- Specified by:
getMaxAccessLevelIdin interfaceAccessLevelService- Returns:
- id of maximal access level or null if does not exist. Instance of
Stringtype. - See Also:
-
getMinAccessLevel
Gets minimal access level.- Specified by:
getMinAccessLevelin interfaceAccessLevelService- Returns:
- minimal access level or null if does not exist. Instance of
AccessLeveltype. - See Also:
-
getMaxAccessLevel
Gets maximal access level.- Specified by:
getMaxAccessLevelin interfaceAccessLevelService- Returns:
- maximal access level or null if does not exist. Instance of
AccessLeveltype. - See Also:
-
getCurrentUserAccessLevel
public short getCurrentUserAccessLevel()Gets current user's maximal access level.- Specified by:
getCurrentUserAccessLevelin interfaceAccessLevelService- Returns:
- number value of maximal access level. Instance of
shorttype. - See Also:
-
getUserAccessLevel
Gets user's maximal access level by user id.- Specified by:
getUserAccessLevelin interfaceAccessLevelService- Parameters:
userId- user account id. Instance ofStringtype.- Returns:
- number value of maximal access level or Short.MIN_VALUE. Instance of
shorttype. - See Also:
-
getGroupsAccessLevel
Gets maximal access level of groups.- Specified by:
getGroupsAccessLevelin interfaceAccessLevelService- Parameters:
groups- collection of groups. Instance ofCollectiontype.- Returns:
- number value of maximal access level or Short.MIN_VALUE. Instance of
shorttype.
-
checkGroupsAccessLevelByIds
Checks the current user's access level to the collection of group ids.- Specified by:
checkGroupsAccessLevelByIdsin interfaceAccessLevelService- Parameters:
groupIds- collection of group ids. Instance ofCollectiontype.- See Also:
-
checkGroupsAccessLevelByIds
Checks user's access level to the the collection of groups ids.- Specified by:
checkGroupsAccessLevelByIdsin interfaceAccessLevelService- Parameters:
groupIds- collection group ids. Instance ofCollectiontype.userId- user account id. Instance ofStringtype.- See Also:
-
checkGroupAccessLevel
Checks the current user's access level to the collection of groups.- Specified by:
checkGroupAccessLevelin interfaceAccessLevelService- Parameters:
groups- collection of groups. Instance ofCollectiontype.- See Also:
-
checkGroupAccessLevel
Checks the user's access level to the collection of groups.- Specified by:
checkGroupAccessLevelin interfaceAccessLevelService- Parameters:
groups- collection of groups. Instance ofCollectiontype.userId- user's id. Instance ofStringtype.- Throws:
AccessDeniedException- if user access level is less than groups access level.- See Also:
-