|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.figure8.join.businessfacades.security.DefaultPermissionManager
public class DefaultPermissionManager
Default implementation of PermissionManager
Field Summary | |
---|---|
protected PermissionDao |
dao
Permission data access object |
protected RoleDao |
roleDao
Role data access object |
Constructor Summary | |
---|---|
DefaultPermissionManager()
Creates a new instance of DefaultPermissionManager |
Method Summary | |
---|---|
Role |
getRole(long id)
Retrieve an application security Role using its unique identifier |
Role |
getRole(java.lang.String name)
Retrieve an application security Role using its name |
java.util.List |
getRoles()
Retrieve the available security roles within application |
java.util.List |
getUserPermissions(User user)
Retrieves all the permission acquired by a specified User |
boolean |
hasPermission(Role role,
java.lang.String userId)
Tells if a user has permission to endorse this security role |
boolean |
hasPermissionForResource(java.lang.Object resource,
Role role,
java.lang.String userId)
Tells if a user has permission to endorse this security role for this resource |
void |
removeAllUserPermissions(User user)
Remove all permissions assigned to a specific user |
void |
removePermission(Permission permission)
Remove a given permission from datastore |
void |
removeRole(Role role)
Remove a given security role from datastore |
void |
savePermission(Permission permission)
Save or update a given permission into datastore |
void |
saveRole(Role role)
Save or update a givean security role into datastore. |
void |
setPermissionDao(PermissionDao dao)
|
void |
setRoleDao(RoleDao dao)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected RoleDao roleDao
protected PermissionDao dao
Constructor Detail |
---|
public DefaultPermissionManager()
Method Detail |
---|
public void setRoleDao(RoleDao dao)
dao
- A Role data access objectpublic void setPermissionDao(PermissionDao dao)
dao
- A Permission data access objectpublic void saveRole(Role role) throws DuplicateEntityException
saveRole
in interface PermissionManager
role
- The security role to save
DuplicateEntityException
- if a role with same name already existspublic void removeRole(Role role)
removeRole
in interface PermissionManager
role
- The role to removepublic java.util.List getRoles()
getRoles
in interface PermissionManager
org.figure8.join.businessobjects.security.Role
public Role getRole(long id)
getRole
in interface PermissionManager
id
- Unique identifier of role within datastore
public Role getRole(java.lang.String name)
getRole
in interface PermissionManager
name
- The name of security role to retrieve
public void savePermission(Permission permission)
savePermission
in interface PermissionManager
permission
- The permission to savepublic void removePermission(Permission permission)
removePermission
in interface PermissionManager
permission
- The permission to removepublic void removeAllUserPermissions(User user)
removeAllUserPermissions
in interface PermissionManager
user
- The user to remove permissions forpublic boolean hasPermission(Role role, java.lang.String userId)
hasPermission
in interface PermissionManager
role
- Security role that has to be endorsed by useruserId
- Id of user for whom permission test is done
public boolean hasPermissionForResource(java.lang.Object resource, Role role, java.lang.String userId)
hasPermissionForResource
in interface PermissionManager
resource
- Entity for whom user should have permissionrole
- Security role that has to be endorsed by useruserId
- Id of user for whom permission test is done
public java.util.List getUserPermissions(User user)
getUserPermissions
in interface PermissionManager
user
- The user to retrieve permissions for
org.figure8.join.businessobjects.security.Permission
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |