com.atlassian.jira.security
Class DefaultGlobalPermissionManager

java.lang.Object
  extended by com.atlassian.jira.security.DefaultGlobalPermissionManager
All Implemented Interfaces:
GlobalPermissionManager

public class DefaultGlobalPermissionManager
extends java.lang.Object
implements GlobalPermissionManager


Constructor Summary
DefaultGlobalPermissionManager()
           
 
Method Summary
 boolean addPermission(int permissionId, java.lang.String group)
          Adds a global permission
 java.util.Collection getGroups(int permissionId)
          Retrieve all the groups with this permission
 java.util.Collection getPermissions(int permissionType)
          Retrieve all the global permissions of a particular type
 boolean hasPermission(int permissionId)
          Check if a global anonymous permission exists
 boolean hasPermission(int permissionId, com.opensymphony.user.User u)
          Check if a global permission for one of the users groups exists
protected  boolean hasPermission(JiraPermission jiraPermission)
           
 boolean removePermission(int permissionId, java.lang.String group)
          Removes a global permission
 boolean removePermissions(java.lang.String group)
          Remove a global permissions that the group passed in
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultGlobalPermissionManager

public DefaultGlobalPermissionManager()
Method Detail

addPermission

public boolean addPermission(int permissionId,
                             java.lang.String group)
                      throws CreateException
Adds a global permission

Specified by:
addPermission in interface GlobalPermissionManager
Parameters:
permissionId - must be a global permission type
group - can be null if it is anyone permission
Returns:
True if the permission was added
Throws:
CreateException

getPermissions

public java.util.Collection getPermissions(int permissionType)
Description copied from interface: GlobalPermissionManager
Retrieve all the global permissions of a particular type

Specified by:
getPermissions in interface GlobalPermissionManager
Parameters:
permissionType - must be a global permission
Returns:
Collection of JiraPermission

removePermission

public boolean removePermission(int permissionId,
                                java.lang.String group)
                         throws RemoveException
Removes a global permission

Specified by:
removePermission in interface GlobalPermissionManager
Parameters:
permissionId - must be a global permission type
group - can be null if it is anyone permission
Returns:
True if the permission was removed, false if not (usually it didn't exist)
Throws:
RemoveException

removePermissions

public boolean removePermissions(java.lang.String group)
                          throws RemoveException
Remove a global permissions that the group passed in

Specified by:
removePermissions in interface GlobalPermissionManager
Parameters:
group - must NOT be null and the group must exist
Returns:
True all the permissions are removed
Throws:
RemoveException

hasPermission

public boolean hasPermission(int permissionId)
Check if a global anonymous permission exists

Specified by:
hasPermission in interface GlobalPermissionManager
Parameters:
permissionId - must be global permission
Returns:

hasPermission

public boolean hasPermission(int permissionId,
                             com.opensymphony.user.User u)
Check if a global permission for one of the users groups exists

Specified by:
hasPermission in interface GlobalPermissionManager
Parameters:
permissionId - must be a global permission
u - must not be null
Returns:

getGroups

public java.util.Collection getGroups(int permissionId)
Retrieve all the groups with this permission

Specified by:
getGroups in interface GlobalPermissionManager
Parameters:
permissionId - must be a global permission
Returns:

hasPermission

protected boolean hasPermission(JiraPermission jiraPermission)


Copyright © 2002-2006 Atlassian. All Rights Reserved.