org.figure8.join.businessfacades.security
Interface PermissionManager

All Known Implementing Classes:
DefaultPermissionManager

public interface PermissionManager

Provides method for managing security roles and permissions.

Version:
$Revision: 1.1 $
Author:
Laurent Broudoux

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 given security role into datastore.
 

Method Detail

saveRole

void saveRole(Role role)
              throws DuplicateEntityException
Save or update a given security role into datastore. This is indeedd a create or update method.

Parameters:
role - The security role to save
Throws:
DuplicateEntityException - if a role with same name already exists

removeRole

void removeRole(Role role)
Remove a given security role from datastore

Parameters:
role - The role to remove

getRoles

java.util.List getRoles()
Retrieve the available security roles within application

Returns:
A List of org.figure8.join.businessobjects.security.Role

getRole

Role getRole(long id)
Retrieve an application security Role using its unique identifier

Parameters:
id - Unique identifier of role within datastore
Returns:
The corresponding role or null if no role has this id

getRole

Role getRole(java.lang.String name)
Retrieve an application security Role using its name

Parameters:
name - The name of security role to retrieve
Returns:
The corresponding role or null if no role has this name

savePermission

void savePermission(Permission permission)
Save or update a given permission into datastore

Parameters:
permission - The permission to save

removePermission

void removePermission(Permission permission)
Remove a given permission from datastore

Parameters:
permission - The permission to remove

removeAllUserPermissions

void removeAllUserPermissions(User user)
Remove all permissions assigned to a specific user

Parameters:
user - The user to remove permissions for

hasPermission

boolean hasPermission(Role role,
                      java.lang.String userId)
Tells if a user has permission to endorse this security role

Parameters:
role - Security role that has to be endorsed by user
userId - Id of user for whom permission test is done
Returns:
true is user as permission corresponding to role, false otherwise

hasPermissionForResource

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

Parameters:
resource - Entity for whom user should have permission
role - Security role that has to be endorsed by user
userId - Id of user for whom permission test is done
Returns:
true is user as permission corresponding to role for resource, false otherwise

getUserPermissions

java.util.List getUserPermissions(User user)
Retrieves all the permission acquired by a specified User

Parameters:
user - The user to retrieve permissions for
Returns:
A list of org.figure8.join.businessobjects.security.Permission


Copyright © 2005-2008 Join. All Rights Reserved.