Package com.easydesk.security.acl
Class EasyDeskAccessControlListImpl
java.lang.Object
com.easydesk.security.acl.EasyDeskAccessControlListImpl
- All Implemented Interfaces:
AccessControlList,EasyDeskAccessControlList<EasyDeskAccessControlListImpl>,Serializable
public final class EasyDeskAccessControlListImpl
extends Object
implements EasyDeskAccessControlList<EasyDeskAccessControlListImpl>
사용자 한 명의 User-Group-Role 정보로 만든 EasyDeskAccessControlList 구현 (PerUserAccessControlList).
생성 이후에는 변경되지 않는(immutable) object 이다.
- Author:
- Youngho Cho
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.easydesk.security.acl.EasyDeskAccessControlList
EasyDeskAccessControlList.STRATAGE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEasyDeskAccessControlListImpl(Set<EasyDeskUserGroupRole> userGroupRoles) Constructs a new AccessControlList. -
Method Summary
Modifier and TypeMethodDescription사용자가 속한 group 별 role 목록을 구한다.Returns all groups which this acl involvedRetrieves a set of Roles an user is assigned in a Group.booleanhasPermission(Role role, Group group, Permission... permissions) 주어진 group 의 role 을 사용자가 가지고 있고, 그 role 에 permission 들이 모두 부여되어 있는지 확인한다.booleanChecks if the user is assigned a specific Role in the Group.toString(){ group, roleSet } map 을 문자열로 구한다.
-
Constructor Details
-
EasyDeskAccessControlListImpl
Constructs a new AccessControlList. This class follows 'immutable' pattern - it's objects can't be modified once they are created. This means that the permissions the users have are in effect form the moment they log in to the moment they log out, and changes made to the security settings in that time are not reflected in the state of this object. If you need to reset an user's permissions you need to invalidate his session.사용자의 EasyDeskUserGroupRole 목록으로 { group, roleSet } map 과 group 목록을 만든다.
- Parameters:
userGroupRoles- 사용자의 User-Group-Role 목록,null이면 빈 ACL 을 만든다.
-
-
Method Details
-
getGroupRoleMap
사용자가 속한 group 별 role 목록을 구한다.- Specified by:
getGroupRoleMapin interfaceEasyDeskAccessControlList<EasyDeskAccessControlListImpl>- Type Parameters:
R- Role type- Returns:
- a map of group, role
-
getGroups
Returns all groups which this acl involved- Specified by:
getGroupsin interfaceEasyDeskAccessControlList<EasyDeskAccessControlListImpl>- Returns:
- a set of groups
-
hasRole
Checks if the user is assigned a specific Role in the Group.- Specified by:
hasRolein interfaceEasyDeskAccessControlList<EasyDeskAccessControlListImpl>- Parameters:
role- the Rolegroup- the Group- Returns:
trueif the user is assigned the Role in the Group.
-
hasPermission
주어진 group 의 role 을 사용자가 가지고 있고, 그 role 에 permission 들이 모두 부여되어 있는지 확인한다.- Specified by:
hasPermissionin interfaceEasyDeskAccessControlList<EasyDeskAccessControlListImpl>- Parameters:
role- if null getAll roles in this group roleSetgroup- if null GroupEnum.GLOBALpermissions- can not be null or empty- Returns:
- 권한이 있으면
true
-
getRoles
Retrieves a set of Roles an user is assigned in a Group.- Specified by:
getRolesin interfaceEasyDeskAccessControlList<EasyDeskAccessControlListImpl>- Parameters:
group- the Group- Returns:
- the set of Roles this user has within the Group. 없으면 빈 RoleSet
- Throws:
IllegalArgumentException- group 이null인 경우
-
toString
{ group, roleSet } map 을 문자열로 구한다.
-