public class

SubvertedPermissionManager

extends Object
implements PermissionManager
java.lang.Object
   ↳ com.atlassian.jira.security.SubvertedPermissionManager

Class Overview

The purpose of this class is to provide a temporary access-all-areas pass and is a (partial) implementation of PermissionManager (subverting the stored permissions). Operations that attempt to specify a change to stored permissions like adding or removing permissions and the getAllGroups() method throw an UnsupportedOperationException.

Summary

Public Constructors
SubvertedPermissionManager()
Public Methods
void addPermission(int permissionsId, GenericValue scheme, String group, String securityType)
Not implemented.
Collection<Group> getAllGroups(int permType, GenericValue entity)
Not implemented.
Collection<Group> getAllGroups(int permType, Project project)
Not implemented.
Collection<Project> getProjectObjects(int permissionId, User user)
Retrieve a list of project objects this user has the permission for
final Collection<Project> getProjectObjects(int permissionId, User user)
Retrieve a list of project objects this user has the permission for
Collection<GenericValue> getProjects(int permissionId, User user, GenericValue category)
Returns all the projects in the given category, or if category is null, all projects in no category.
final Collection<GenericValue> getProjects(int permissionId, User user, GenericValue category)
Retrieve a list of projects associated with the specified category, that this user has the permissions for
final Collection<GenericValue> getProjects(int permissionId, User user)
Retrieve a list of projects this user has the permission for
final Collection<GenericValue> getProjects(int permissionId, User user)
Simply returns all projects.
boolean hasPermission(int permissionsId, Project project, User user)
Always return true.
final boolean hasPermission(int permissionsId, Project project, User user)
Checks whether the specified user has a specified permission within the context of a specified project.
final boolean hasPermission(int permissionsId, Project project, User user, boolean issueCreation)
Checks whether the specified user has a specified permission within the context of a specified project.
final boolean hasPermission(int permissionsId, User user)
Checks to see if this user has the specified permission.
boolean hasPermission(int permissionsId, GenericValue project, User u, boolean issueCreation)
Always return true.
final boolean hasPermission(int permissionsId, Issue entity, User u)
Does the same as hasPermission(int, org.ofbiz.core.entity.GenericValue, User) except the entity is an issue.
boolean hasPermission(int permissionsId, Project project, User user, boolean issueCreation)
Always return true.
boolean hasPermission(int permissionType, User u)
Always returns true.
boolean hasPermission(int permissionsId, Issue issue, User u)
Always returns true.
boolean hasPermission(int permissionsId, GenericValue entity, User u)
Always returns true.
final boolean hasPermission(int permissionsId, GenericValue entity, User u)
Checks to see if this has permission to see the specified entity.
final boolean hasPermission(int permissionsId, GenericValue project, User u, boolean issueCreation)
Does the same as hasPermission(int, org.ofbiz.core.entity.GenericValue, User) except the entity is a project GenericValue.
final boolean hasProjects(int permissionId, User user)
Can this user see at least one project with this permission
boolean hasProjects(int permissionId, User user)
Returns true if there are any projects at all.
void removeGroupPermissions(String group)
Not implemented.
void removeUserPermissions(String group)
Not implemented.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.security.PermissionManager

Public Constructors

public SubvertedPermissionManager ()

Public Methods

public void addPermission (int permissionsId, GenericValue scheme, String group, String securityType)

Not implemented.

Parameters
permissionsId Permissions value. E.g. See ADMINISTER
scheme If null permission is global otherwise it is added to the scheme
group Used for e.g. group name
securityType e.g. GroupDropdown.DESC

public Collection<Group> getAllGroups (int permType, GenericValue entity)

Not implemented.

Parameters
permType permission id
entity project to retrieve groups from
Returns
  • a collection of Groups

public Collection<Group> getAllGroups (int permType, Project project)

Not implemented.

Parameters
permType permission id
project project from which to retrieve groups
Returns
  • a collection of Groups

public Collection<Project> getProjectObjects (int permissionId, User user)

Retrieve a list of project objects this user has the permission for

Parameters
permissionId must NOT be a global permission
user user
Returns

public final Collection<Project> getProjectObjects (int permissionId, User user)

Retrieve a list of project objects this user has the permission for

Parameters
permissionId must NOT be a global permission
user user
Returns

public Collection<GenericValue> getProjects (int permissionId, User user, GenericValue category)

Returns all the projects in the given category, or if category is null, all projects in no category.

Parameters
permissionId ignored.
user ignored.
category the category for which to get projects.
Returns
  • the projects.

public final Collection<GenericValue> getProjects (int permissionId, User user, GenericValue category)

Retrieve a list of projects associated with the specified category, that this user has the permissions for

Parameters
permissionId permission id
user user
category GenericValue representing category
Returns
  • a collection of GenericValue objects

public final Collection<GenericValue> getProjects (int permissionId, User user)

Retrieve a list of projects this user has the permission for

Parameters
permissionId must NOT be a global permission
user user
Returns
  • a collection of GenericValue objects

public final Collection<GenericValue> getProjects (int permissionId, User user)

Simply returns all projects.

Parameters
permissionId unused.
user unused.
Returns
  • all the projects.

public boolean hasPermission (int permissionsId, Project project, User user)

Always return true.

Parameters
permissionsId ignored
project ignored
user ignored
Returns
  • true

public final boolean hasPermission (int permissionsId, Project project, User user)

Checks whether the specified user has a specified permission within the context of a specified project.

Parameters
permissionsId A non-global permission, i.e. a permission that is granted via a project context
project The project that is the context of the permission check.
user The person to perform the permission check for
Returns
  • true if the user has the specified permission in the context of the supplied project

public final boolean hasPermission (int permissionsId, Project project, User user, boolean issueCreation)

Checks whether the specified user has a specified permission within the context of a specified project.

Parameters
permissionsId A non-global permission, i.e. a permission that is granted via a project context
project The project that is the context of the permission check.
user The person to perform the permission check for
issueCreation Whether this permission is being checked during issue creation
Returns
  • true if the user has the specified permission in the context of the supplied project

public final boolean hasPermission (int permissionsId, User user)

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 permission id
user user, can be null - anonymous user
Returns
  • true if user is granted given permission, false otherwise

public boolean hasPermission (int permissionsId, GenericValue project, User u, boolean issueCreation)

Always return true.

Parameters
permissionsId ignored
project ignored
u ignored
issueCreation ignored
Returns
  • true

public final boolean hasPermission (int permissionsId, Issue entity, User u)

Does the same as hasPermission(int, org.ofbiz.core.entity.GenericValue, User) except the entity is an issue.

Note that if the issue's generic value is null, it is assumed that the issue is currently being created, and so the permission check call is deferred to the issue's project object, with the issueCreation flag set to true. See JRA-14788 for more info.
Parameters
permissionsId Not a global permission
entity Not null.
u User object, possibly null if JIRA is accessed anonymously
Returns
  • True if there are sufficient rights to access the entity supplied

public boolean hasPermission (int permissionsId, Project project, User user, boolean issueCreation)

Always return true.

Parameters
permissionsId ignored
project ignored
user ignored
issueCreation ignored
Returns
  • true

public boolean hasPermission (int permissionType, User u)

Always returns true.

Parameters
permissionType ignored
u ignored
Returns
  • true

public boolean hasPermission (int permissionsId, Issue issue, User u)

Always returns true.

Parameters
permissionsId ignored
issue ignored
u ignored
Returns
  • true

public boolean hasPermission (int permissionsId, GenericValue entity, User u)

Always returns true.

Parameters
permissionsId ignored
entity ignored
u ignored
Returns
  • true

public final boolean hasPermission (int permissionsId, GenericValue entity, 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. Must be either an issue or project.
u User object, possibly null if JIRA is accessed anonymously
Returns
  • True if there are sufficient rights to access the entity supplied

public final boolean hasPermission (int permissionsId, GenericValue project, User u, boolean issueCreation)

Does the same as hasPermission(int, org.ofbiz.core.entity.GenericValue, User) except the entity is a project GenericValue.

Parameters
permissionsId Not a global permission
project Not null.
u User object, possibly null if JIRA is accessed anonymously
issueCreation Whether this permission is being checked during issue creation
Returns
  • True if there are sufficient rights to access the entity supplied

public final boolean hasProjects (int permissionId, User user)

Can this user see at least one project with this permission

Parameters
permissionId must NOT be a global permission
user user being checked
Returns
  • true the given user can see at least one project with the given permission, false otherwise

public boolean hasProjects (int permissionId, User user)

Returns true if there are any projects at all.

Parameters
permissionId ignored.
user ignored.
Returns
  • true if there are any projects.

public void removeGroupPermissions (String group)

Not implemented.

Parameters
group The name of the group that needs to be removed, must NOT be null and must be a real group

public void removeUserPermissions (String group)

Not implemented.

Parameters
group username of the user whose permissions are to be removed