Package com.easydesk.security.model
Class EasyDeskModelManager
java.lang.Object
com.easydesk.security.model.EasyDeskModelManager
- All Implemented Interfaces:
SecurityEntityModelManager,Serializable
This implementation persists user-group-role-permission relation to a
database via Torque.
관계를 제거할 때는 대부분 record 를 삭제하지 않고 삭제 표시(deleted mark)를 한다.
(단, revokeAll(Group) 은 record 를 삭제한다.)
- Version:
- $Id:$
- Author:
- Thomas Vandahl, Youngho Cho
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription사용자의 User-Group-Role 정보로 AccessControlList 를 생성한다.voidGroup 에 Role 을 부여한다.voidgrant(Role role, Permission permission) Grants a Role a Permission.voidGrant an User a Role in a Group.voidReplaces the assigned old Role to new role in the given group for User user.voidGroup 에서 Role 을 제거한다.voidrevoke(Role role, Permission permission) Revokes a Permission from a Role.voidRevoke a Role in a Group from an User.voidRevokes all roles and users from a Group.voidRevokes all permissions from a Role.voidRevokes all roles in the group from an User.
-
Constructor Details
-
EasyDeskModelManager
public EasyDeskModelManager()
-
-
Method Details
-
getACL
사용자의 User-Group-Role 정보로 AccessControlList 를 생성한다.- Specified by:
getACLin interfaceSecurityEntityModelManager- Parameters:
user- 대상 사용자- Returns:
- acl for the user. If the user is not present, an empty ACL is returned.
-
revokeAll
Revokes all roles in the group from an User. This method is typically used when deleting an account.사용자의 User-Group-Role 중 주어진 group 의 것에 삭제 표시를 한다. group 이
null이면 모든 group 의 역할을 회수한다. 저장에 실패한 항목은 log 만 남기고 계속 진행한다.- Specified by:
revokeAllin interfaceSecurityEntityModelManager- Parameters:
user- the User.group- the Group,null이면 모든 group- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if the account is not present.
-
revokeAll
Revokes all permissions from a Role. This method is typically used when deleting a Role. 제거에 실패한 permission 은 log 만 남기고 계속 진행한다.- Specified by:
revokeAllin interfaceSecurityEntityModelManager- Parameters:
role- the Role- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if the Role is not present.
-
revokeAll
Revokes all roles and users from a Group. This method is typically used when deleting a Group. Group 의 User-Group-Role record 를 삭제한다.- Specified by:
revokeAllin interfaceSecurityEntityModelManager- Parameters:
group- the Group- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if the Group is not present.
-
grant
public void grant(Role role, Permission permission) throws DataBackendException, UnknownEntityException Grants a Role a Permission. 이미 부여되어 있으면 아무 것도 하지 않는다.- Specified by:
grantin interfaceSecurityEntityModelManager- Parameters:
role- the Role.permission- the Permission.- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if role or permission is not present.
-
revoke
public void revoke(Role role, Permission permission) throws DataBackendException, UnknownEntityException Revokes a Permission from a Role. Role-Permission record 에 삭제 표시를 한다.- Specified by:
revokein interfaceSecurityEntityModelManager- Parameters:
role- the Role.permission- the Permission.- Throws:
DataBackendException- if there was an error accessing the data backend or the Role-Permission record does not exist.UnknownEntityException- if role or permission is not present.
-
grant
public void grant(User user, Group group, Role role) throws DataBackendException, UnknownEntityException Grant an User a Role in a Group. User-Group-Role record 를 새로 저장한다. (중복 여부는 확인하지 않는다)- Specified by:
grantin interfaceSecurityEntityModelManager- Parameters:
user- the user.group- the group.role- the role.- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if user account, group or role is not present.
-
revoke
public void revoke(User user, Group group, Role role) throws DataBackendException, UnknownEntityException Revoke a Role in a Group from an User. 해당 User-Group-Role record 에 삭제 표시를 한다.- Specified by:
revokein interfaceSecurityEntityModelManager- Parameters:
user- the user.group- the group.role- the role.- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if user account, group or role is not present.
-
replace
public void replace(User user, Group group, Role oldRole, Role newRole) throws DataBackendException, UnknownEntityException Replaces the assigned old Role to new role in the given group for User user. oldRole 을 revoke 한 후 newRole 을 grant 한다.- Specified by:
replacein interfaceSecurityEntityModelManager- Parameters:
user- the User.group- the GroupoldRole- the old RolenewRole- the new Role- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if user account, group or role is not present.
-
grant
Group 에 Role 을 부여한다. Group-Role record 를 새로 저장한다.- Specified by:
grantin interfaceSecurityEntityModelManager- Parameters:
role- the role.group- the group.- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if group or role is not present.
-
revoke
Group 에서 Role 을 제거한다. Group-Role record 에 삭제 표시를 한다.- Specified by:
revokein interfaceSecurityEntityModelManager- Parameters:
role- the role.group- the group.- Throws:
DataBackendException- if there was an error accessing the data backend or the Group-Role record does not exist.UnknownEntityException- if group or role is not present.
-