com.atlassian.crowd.manager.permission
Class PermissionManagerImpl

java.lang.Object
  extended by com.atlassian.crowd.manager.permission.PermissionManagerImpl
All Implemented Interfaces:
PermissionManager

@Transactional
public class PermissionManagerImpl
extends Object
implements PermissionManager

Implementation of the PermissionManager


Constructor Summary
PermissionManagerImpl(ApplicationDAO applicationDao, DirectoryDao directoryDao)
           
 
Method Summary
 void addPermission(Application application, Directory directory, OperationType operationType)
          Adds a permission for the given OperationType to an Application+Directory mapping.
 void addPermission(Directory directory, OperationType operationType)
           
 boolean hasPermission(Application application, Directory directory, OperationType operationType)
          Determine whether an application has permission to execute a particular operation on a given directory.
 boolean hasPermission(Directory directory, OperationType operationType)
          Determine whether a directory has the permission to perform a certain operation.
 void removePermission(Application application, Directory directory, OperationType operationType)
          Removes a permission with the given OperationType from the Application+Directory mapping
 void removePermission(Directory directory, OperationType operationType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermissionManagerImpl

public PermissionManagerImpl(ApplicationDAO applicationDao,
                             DirectoryDao directoryDao)
Method Detail

hasPermission

public boolean hasPermission(Directory directory,
                             OperationType operationType)
Description copied from interface: PermissionManager
Determine whether a directory has the permission to perform a certain operation.

Specified by:
hasPermission in interface PermissionManager
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: PermissionManager
Determine whether an application has permission to execute a particular operation on a given directory.

Specified by:
hasPermission in interface PermissionManager
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 & directory has this permission, false otherwise.

removePermission

public void removePermission(Directory directory,
                             OperationType operationType)
                      throws DirectoryNotFoundException
Specified by:
removePermission in interface PermissionManager
Throws:
DirectoryNotFoundException

removePermission

public void removePermission(Application application,
                             Directory directory,
                             OperationType operationType)
                      throws ApplicationNotFoundException
Description copied from interface: PermissionManager
Removes a permission with the given OperationType from the Application+Directory mapping

Specified by:
removePermission in interface PermissionManager
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:
addPermission in interface PermissionManager
Throws:
DirectoryNotFoundException

addPermission

public void addPermission(Application application,
                          Directory directory,
                          OperationType operationType)
                   throws ApplicationNotFoundException
Description copied from interface: PermissionManager
Adds a permission for the given OperationType to an Application+Directory mapping.

Specified by:
addPermission in interface PermissionManager
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


Copyright © 2014 Atlassian. All Rights Reserved.