public class ProjectAccessController extends AbstractProfileStorageBasedAccessController implements Contextualizable
AccessController
for a Project
The projects' managers have all rights on their projectsAbstractProfileStorageBasedAccessController.CacheKind
AccessController.AccessResult
Modifier and Type | Field and Description |
---|---|
private static String |
__RIGHT_PROJECT_FO_EDIT |
protected Context |
_context
The avalon context
|
protected ProjectManager |
_projectManager
The project manager
|
protected SiteManager |
_siteManager
The web site manager
|
__ANONYMOUS_USER_IDENTITY, __ANY_CONTECTED_USER_IDENTITY, _profileAssignmentStorageEP, _rightManager, _rightProfileDAO
Constructor and Description |
---|
ProjectAccessController() |
Modifier and Type | Method and Description |
---|---|
protected Set<? extends Object> |
_convertWorkspaceToRootRightContexts(Set<Object> workspacesContexts)
Get the current workspaces contexts and turn it into root contexts in order to allow methods hasXXXAnyPermissionOnWorkspace to work
|
void |
contextualize(Context context) |
AccessController.AccessResult |
getPermission(UserIdentity user,
Set<GroupIdentity> userGroups,
String rightId,
Object object)
Gets the kind of access a user has on an object for a given right
|
Map<String,AccessController.AccessResult> |
getPermissionByRight(UserIdentity user,
Set<GroupIdentity> userGroups,
Object object)
Gets the kind of access a user has on an object for all rights
|
Map<UserIdentity,AccessController.AccessResult> |
getPermissionByUser(String rightId,
Object object)
Gets the permission by user only on an object for the given right.
|
boolean |
hasUserAnyPermissionOnWorkspace(Set<Object> workspacesContexts,
UserIdentity user,
Set<GroupIdentity> userGroups,
String rightId)
Returns true if the user has a permission on at least one object, directly or though groups, for a given rights and if the object is attached to the given context that is /${WorkspaceName} and its conversions.
|
boolean |
isSupported(Object object)
Returns true if this access controller supports the given object
|
void |
service(ServiceManager manager) |
_convertContext, _getPermission, _getPermissionByGroup, _getPermissionByUser, _getPermissionForAnonymous, _getPermissionForAnyConnectedUser, _hasRightResultInFirstCache, _hasRightResultInSecondCache, _putInFirstCache, _putInSecondCache, getPermissionByGroup, getPermissionForAnonymous, getPermissionForAnyConnectedUser, getReadAccessPermission, getReadAccessPermissionByGroup, getReadAccessPermissionByUser, getReadAccessPermissionForAnonymous, getReadAccessPermissionForAnyConnectedUser, hasAnonymousAnyPermissionOnWorkspace, hasAnonymousAnyReadAccessPermissionOnWorkspace, hasAnyConnectedUserAnyPermissionOnWorkspace, hasAnyConnectedUserAnyReadAccessPermissionOnWorkspace, hasUserAnyReadAccessPermissionOnWorkspace
getLogger, setLogger
private static final String __RIGHT_PROJECT_FO_EDIT
protected SiteManager _siteManager
protected ProjectManager _projectManager
public ProjectAccessController()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
service
in class AbstractProfileStorageBasedAccessController
ServiceException
public boolean isSupported(Object object)
AccessController
isSupported
in interface AccessController
object
- The object to testprotected Set<? extends Object> _convertWorkspaceToRootRightContexts(Set<Object> workspacesContexts)
AbstractProfileStorageBasedAccessController
_convertWorkspaceToRootRightContexts
in class AbstractProfileStorageBasedAccessController
workspacesContexts
- The workspace contexts. Such as '/${WorkspaceName}', '/admin'public AccessController.AccessResult getPermission(UserIdentity user, Set<GroupIdentity> userGroups, String rightId, Object object)
AccessController
getPermission
in interface AccessController
getPermission
in class AbstractProfileStorageBasedAccessController
user
- The user. Cannot be null.userGroups
- The groups the user belongs torightId
- The id of the right of the userobject
- The context object to check the accesspublic Map<String,AccessController.AccessResult> getPermissionByRight(UserIdentity user, Set<GroupIdentity> userGroups, Object object)
AccessController
getPermissionByRight
in interface AccessController
getPermissionByRight
in class AbstractProfileStorageBasedAccessController
user
- The user. Cannot be null.userGroups
- The groups the user belongs toobject
- The context object to check the accesspublic Map<UserIdentity,AccessController.AccessResult> getPermissionByUser(String rightId, Object object)
AccessController
getPermissionByUser
in interface AccessController
getPermissionByUser
in class AbstractProfileStorageBasedAccessController
rightId
- The id of the right to checkobject
- The objectpublic boolean hasUserAnyPermissionOnWorkspace(Set<Object> workspacesContexts, UserIdentity user, Set<GroupIdentity> userGroups, String rightId)
AccessController
hasUserAnyPermissionOnWorkspace
in interface AccessController
hasUserAnyPermissionOnWorkspace
in class AbstractProfileStorageBasedAccessController
workspacesContexts
- The contexts to tests such as {"/${WorkspaceName}", "/repository", "/admin"}user
- The useruserGroups
- The groupsrightId
- The id of the right to check