com.atlassian.jira.security
Interface PermissionManager

All Superinterfaces:
JiraManager
All Known Implementing Classes:
AbstractPermissionManager, SubvertedPermissionManager

public interface PermissionManager
extends JiraManager


Method Summary
 void addPermission(int permissionsId, org.ofbiz.core.entity.GenericValue scheme, java.lang.String parameter, java.lang.String securityType)
          Adds a permission to the system
 java.util.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
 java.util.Collection getProjects(int permissionId, com.opensymphony.user.User user)
          Retrieve a list of projects this user has the permission for
 java.util.Collection getProjects(int permissionId, com.opensymphony.user.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 entity, com.opensymphony.user.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 project, com.opensymphony.user.User u, boolean issueCreation)
           
 boolean hasPermission(int permissionsId, com.opensymphony.user.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, com.opensymphony.user.User user)
          Can this user see atleast one project with this permission
 void removeGroupPermissions(java.lang.String group)
          Remove all permissions that have used this group
 

Method Detail

addPermission

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

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,
                             com.opensymphony.user.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

Parameters:
permissionsId -
u -
Returns:

hasPermission

public boolean hasPermission(int permissionsId,
                             org.ofbiz.core.entity.GenericValue entity,
                             com.opensymphony.user.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

Parameters:
permissionsId - , not a global permission
entity - not null
u -
Returns:

hasPermission

public boolean hasPermission(int permissionsId,
                             org.ofbiz.core.entity.GenericValue project,
                             com.opensymphony.user.User u,
                             boolean issueCreation)

removeGroupPermissions

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

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,
                           com.opensymphony.user.User user)
                    throws java.lang.Exception
Can this user see atleast one project with this permission

Parameters:
permissionId - must NOT be a global permission
user -
Returns:
Throws:
java.lang.Exception

getProjects

public java.util.Collection getProjects(int permissionId,
                                        com.opensymphony.user.User user)
                                 throws org.ofbiz.core.entity.GenericEntityException
Retrieve a list of projects this user has the permission for

Parameters:
permissionId - must NOT be a global permission
user -
Returns:
Throws:
org.ofbiz.core.entity.GenericEntityException

getProjects

public java.util.Collection getProjects(int permissionId,
                                        com.opensymphony.user.User user,
                                        org.ofbiz.core.entity.GenericValue category)
                                 throws org.ofbiz.core.entity.GenericEntityException
Retrieve a list of projects associated with the specified category, that this user has the permissions for

Parameters:
permissionId -
user -
category -
Returns:
Throws:
org.ofbiz.core.entity.GenericEntityException

getAllGroups

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

Parameters:
permissionId -
project - project to retireve groups from
Returns:
Throws:
java.lang.Exception


Copyright © 2002-2005 Atlassian. All Rights Reserved.