com.atlassian.jira.security
Class AbstractPermissionManager

java.lang.Object
  extended bycom.atlassian.jira.security.AbstractPermissionManager
All Implemented Interfaces:
JiraManager, PermissionManager
Direct Known Subclasses:
DefaultPermissionManager

public abstract class AbstractPermissionManager
extends Object
implements PermissionManager

An abstract PermissionManager that implements a lot of the common functionality to all PermissionManagers.

See Also:
DefaultPermissionManager

Constructor Summary
AbstractPermissionManager()
           
 
Method Summary
 void addPermission(int permissionsId, org.ofbiz.core.entity.GenericValue scheme, String parameter, String securityType)
          Adds a permission to the system
 Collection getAllGroups(int permissionId, org.ofbiz.core.entity.GenericValue project)
          Retrieve all groups that are used in the permission globally and in the project entity
 Collection getProjects(int permissionId, User user)
          Retrieve a list of projects this user has the permission for
 Collection getProjects(int permissionId, User user, org.ofbiz.core.entity.GenericValue category)
          Retrieve a list of projects associated with the specified category, that this user has the permissions for
 boolean hasPermission(int permissionsId, org.ofbiz.core.entity.GenericValue projectOrIssue, User u)
          Checks to see if this has permission to see the specified entity
Check Permissions scheme(s) if the entity is project
Check Permissions scheme(s) and issue level security scheme(s) if the entity is an issue
 boolean hasPermission(int permissionsId, org.ofbiz.core.entity.GenericValue entity, User u, boolean issueCreation)
           
 boolean hasPermission(int permissionsId, Issue issue, User u)
           
 boolean hasPermission(int permissionsId, User u)
          Checks to see if this user has the specified permission
It will check only global permissions as there are no other permissions to check
 boolean hasProjects(int permissionId, User user)
          Can this user see atleast one project with this permission
 void removeGroupPermissions(String group)
          Remove all permissions that have used this group
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPermissionManager

public AbstractPermissionManager()
Method Detail

addPermission

public void addPermission(int permissionsId,
                          org.ofbiz.core.entity.GenericValue scheme,
                          String parameter,
                          String securityType)
                   throws CreateException
Adds a permission to the system

Specified by:
addPermission in interface PermissionManager
Parameters:
permissionsId - Permissions value
scheme - If null permission is global otherwise it is added to the scheme
parameter - Used for e.g. group name
securityType - e.g. GroupDropdown.DESC
Throws:
CreateException

hasPermission

public boolean hasPermission(int permissionsId,
                             User u)
Checks to see if this user has the specified permission
It will check only global permissions as there are no other permissions to check

Specified by:
hasPermission in interface PermissionManager
Parameters:
permissionsId -
u -

hasPermission

public boolean hasPermission(int permissionsId,
                             org.ofbiz.core.entity.GenericValue projectOrIssue,
                             User u)
Checks to see if this has permission to see the specified entity
Check Permissions scheme(s) if the entity is project
Check Permissions scheme(s) and issue level security scheme(s) if the entity is an issue

Specified by:
hasPermission in interface PermissionManager
Parameters:
permissionsId - , not a global permission
projectOrIssue - not null must be Project or Issue
u - User object, possibly null if JIRA is accessed anonymously

hasPermission

public boolean hasPermission(int permissionsId,
                             Issue issue,
                             User u)
Specified by:
hasPermission in interface PermissionManager

hasPermission

public boolean hasPermission(int permissionsId,
                             org.ofbiz.core.entity.GenericValue entity,
                             User u,
                             boolean issueCreation)
Specified by:
hasPermission in interface PermissionManager

removeGroupPermissions

public void removeGroupPermissions(String group)
                            throws RemoveException
Remove all permissions that have used this group

Specified by:
removeGroupPermissions in interface PermissionManager
Parameters:
group - The name of the group that needs to be removed, must NOT be null and must be a real group
Throws:
RemoveException

hasProjects

public boolean hasProjects(int permissionId,
                           User user)
                    throws Exception
Can this user see atleast one project with this permission

Specified by:
hasProjects in interface PermissionManager
Parameters:
permissionId - must NOT be a global permission
user -
Throws:
Exception

getProjects

public Collection getProjects(int permissionId,
                              User user)
Retrieve a list of projects this user has the permission for

Specified by:
getProjects in interface PermissionManager
Parameters:
permissionId - must NOT be a global permission
user -

getProjects

public Collection getProjects(int permissionId,
                              User user,
                              org.ofbiz.core.entity.GenericValue category)
                       throws org.ofbiz.core.entity.GenericEntityException
Description copied from interface: PermissionManager
Retrieve a list of projects associated with the specified category, that this user has the permissions for

Specified by:
getProjects in interface PermissionManager
Parameters:
permissionId -
user -
category -
Throws:
org.ofbiz.core.entity.GenericEntityException

getAllGroups

public Collection getAllGroups(int permissionId,
                               org.ofbiz.core.entity.GenericValue project)
                        throws Exception
Retrieve all groups that are used in the permission globally and in the project entity

Specified by:
getAllGroups in interface PermissionManager
Parameters:
permissionId -
project - project to retireve groups from
Throws:
Exception


Copyright © 2002-2006 Atlassian. All Rights Reserved.