com.atlassian.jira.security
Interface GlobalPermissionManager

All Known Implementing Classes:
DefaultGlobalPermissionManager

public interface GlobalPermissionManager


Method Summary
 boolean addPermission(int permissionType, String group)
          Adds a global permission
 Collection getGroupNames(int permissionId)
          Retrieve all the group names with this permission.
 Collection getGroups(int permissionId)
          Retrieve all the groups with this permission.
 Collection getPermissions(int permissionType)
          Retrieve all the global permissions of a particular type
 boolean hasPermission(int permissionType)
          Check if a global permission is granted for an Anonymous user.
 boolean hasPermission(int permissionType, User u)
          Check if a global permission for one of the users groups exists.
 boolean removePermission(int permissionType, String group)
          Removes a global permission
 boolean removePermissions(String group)
          Remove a global permissions that the group passed in
 

Method Detail

addPermission

boolean addPermission(int permissionType,
                      String group)
                      throws CreateException
Adds a global permission

Parameters:
permissionType - 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

Collection getPermissions(int permissionType)
Retrieve all the global permissions of a particular type

Parameters:
permissionType - must be a global permission
Returns:
Collection of JiraPermission, must never return null

removePermission

boolean removePermission(int permissionType,
                         String group)
                         throws RemoveException
Removes a global permission

Parameters:
permissionType - 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

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

Parameters:
group - must NOT be null and the group must exist
Returns:
True all the permissions are removed
Throws:
RemoveException

hasPermission

boolean hasPermission(int permissionType)
Check if a global permission is granted for an Anonymous user.

If the permission type is Permissions.ADMINISTER and the lookup is false then the same query will be executed for the Permissions.SYSTEM_ADMIN permission type, since it is implied that having a Permissions.SYSTEM_ADMIN permission grants Permissions.ADMINISTER rights.

Parameters:
permissionType - must be global permission

hasPermission

boolean hasPermission(int permissionType,
                      User u)
Check if a global permission for one of the users groups exists.

If the permission type is Permissions.ADMINISTER and the lookup is false then the same query will be executed for the Permissions.SYSTEM_ADMIN permission type, since it is implied that having a Permissions.SYSTEM_ADMIN permission grants Permissions.ADMINISTER rights.

Parameters:
permissionType - must be a global permission
u - must not be null

getGroups

Collection getGroups(int permissionId)
Retrieve all the groups with this permission. Only groups directly associated with the permission will be returned.

Parameters:
permissionId - must be a global permission
Returns:
a Collection of Group's, will never be null.

getGroupNames

Collection getGroupNames(int permissionId)
Retrieve all the group names with this permission. Only group names directly associated with the permission will be returned.

Parameters:
permissionId - must be a global permission
Returns:
a Collection of String, group names, will never be null.


Copyright © 2002-2007 Atlassian. All Rights Reserved.