Class PermissionManagerImpl
java.lang.Object
com.atlassian.crowd.manager.permission.PermissionManagerImpl
- All Implemented Interfaces:
PermissionManager
Implementation of the
PermissionManager.-
Constructor Summary
ConstructorsConstructorDescriptionPermissionManagerImpl(ApplicationDAO applicationDao, DirectoryDao directoryDao, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPermission(Directory directory, OperationType operationType) voidaddPermission(Application application, Directory directory, OperationType operationType) Adds a permission for the givenOperationTypeto an Application+Directory mapping.booleanhasPermission(Directory directory, OperationType operationType) Determine whether a directory has the permission to perform a certain operation.booleanhasPermission(Application application, Directory directory, OperationType operationType) Determine whether an application has permission to execute a particular operation on a given directory.voidremovePermission(Directory directory, OperationType operationType) voidremovePermission(Application application, Directory directory, OperationType operationType) Removes a permission with the givenOperationTypefrom the Application+Directory mapping
-
Constructor Details
-
PermissionManagerImpl
public PermissionManagerImpl(ApplicationDAO applicationDao, DirectoryDao directoryDao, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
hasPermission
Description copied from interface:PermissionManagerDetermine whether a directory has the permission to perform a certain operation.- Specified by:
hasPermissionin interfacePermissionManager- Parameters:
directory- the directory to validate the permission against.operationType- the OperationType to check against.- Returns:
- true if and only if the directory is allowed to perform this operation.
-
hasPermission
public boolean hasPermission(Application application, Directory directory, OperationType operationType) Description copied from interface:PermissionManagerDetermine whether an application has permission to execute a particular operation on a given directory.- Specified by:
hasPermissionin interfacePermissionManager- Parameters:
application- application that wants to perform the operation.directory- directory to perform the operation on.operationType- type of operation to perform.- Returns:
- true if the application and directory has this permission, false otherwise.
-
removePermission
public void removePermission(Directory directory, OperationType operationType) throws DirectoryNotFoundException - Specified by:
removePermissionin interfacePermissionManager- Throws:
DirectoryNotFoundException
-
removePermission
public void removePermission(Application application, Directory directory, OperationType operationType) throws ApplicationNotFoundException Description copied from interface:PermissionManagerRemoves a permission with the givenOperationTypefrom the Application+Directory mapping- Specified by:
removePermissionin interfacePermissionManager- Parameters:
application- application that wants to perform the operation.directory- directory to forbid the operation on.operationType- type of operation to forbid.- Throws:
ApplicationNotFoundException- if the application could not be found
-
addPermission
public void addPermission(Directory directory, OperationType operationType) throws DirectoryNotFoundException - Specified by:
addPermissionin interfacePermissionManager- Throws:
DirectoryNotFoundException
-
addPermission
public void addPermission(Application application, Directory directory, OperationType operationType) throws ApplicationNotFoundException Description copied from interface:PermissionManagerAdds a permission for the givenOperationTypeto an Application+Directory mapping.- Specified by:
addPermissionin interfacePermissionManager- Parameters:
application- application that wants to perform the operation.directory- directory to allow the operation on.operationType- type of operation to forbid.- Throws:
ApplicationNotFoundException- if the application could not be found
-