|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.security.SubvertedPermissionManager
public class SubvertedPermissionManager
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.
Constructor Summary | |
---|---|
SubvertedPermissionManager()
|
Method Summary | |
---|---|
void |
addPermission(int permissionsId,
org.ofbiz.core.entity.GenericValue scheme,
String group,
String securityType)
Not implemented. |
Collection<Group> |
getAllGroups(int permType,
org.ofbiz.core.entity.GenericValue entity)
Not implemented. |
Collection<com.atlassian.crowd.embedded.api.Group> |
getAllGroups(int permType,
Project project)
Not implemented. |
Collection<Project> |
getProjectObjects(int permissionId,
com.atlassian.crowd.embedded.api.User user)
Retrieve a list of project objects this user has the permission for |
Collection<Project> |
getProjectObjects(int permissionId,
User user)
Retrieve a list of project objects this user has the permission for |
Collection<org.ofbiz.core.entity.GenericValue> |
getProjects(int permissionId,
User user)
Simply returns all projects. |
Collection<org.ofbiz.core.entity.GenericValue> |
getProjects(int permissionId,
com.atlassian.crowd.embedded.api.User user)
Retrieve a list of projects this user has the permission for |
Collection<org.ofbiz.core.entity.GenericValue> |
getProjects(int permissionId,
com.atlassian.crowd.embedded.api.User user,
org.ofbiz.core.entity.GenericValue category)
Returns all the projects in the given category, or if category is null, all projects in no category. |
Collection<org.ofbiz.core.entity.GenericValue> |
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 entity,
com.atlassian.crowd.embedded.api.User u)
Always returns true. |
boolean |
hasPermission(int permissionsId,
org.ofbiz.core.entity.GenericValue entity,
User u)
Checks to see if this has permission to see the specified entity. |
boolean |
hasPermission(int permissionsId,
org.ofbiz.core.entity.GenericValue project,
com.atlassian.crowd.embedded.api.User u,
boolean issueCreation)
Always return true. |
boolean |
hasPermission(int permissionsId,
org.ofbiz.core.entity.GenericValue project,
User u,
boolean issueCreation)
Does the same as PermissionManager.hasPermission(int,org.ofbiz.core.entity.GenericValue,User) except
the entity is a project GenericValue . |
boolean |
hasPermission(int permissionsId,
Issue issue,
com.atlassian.crowd.embedded.api.User u)
Always returns true. |
boolean |
hasPermission(int permissionsId,
Issue entity,
User u)
Does the same as PermissionManager.hasPermission(int,org.ofbiz.core.entity.GenericValue,User) except
the entity is an issue. |
boolean |
hasPermission(int permissionsId,
Project project,
com.atlassian.crowd.embedded.api.User user)
Always return true. |
boolean |
hasPermission(int permissionsId,
Project project,
User user)
Checks whether the specified user has a specified permission within the context of a specified project. |
boolean |
hasPermission(int permissionsId,
Project project,
com.atlassian.crowd.embedded.api.User user,
boolean issueCreation)
Always return true. |
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. |
boolean |
hasPermission(int permissionType,
com.atlassian.crowd.embedded.api.User u)
Always returns true. |
boolean |
hasPermission(int permissionsId,
User user)
Checks to see if this user has the specified permission. |
boolean |
hasProjects(int permissionId,
com.atlassian.crowd.embedded.api.User user)
Returns true if there are any projects at all. |
boolean |
hasProjects(int permissionId,
User user)
Can this user see at least one project with this permission |
void |
removeGroupPermissions(String group)
Not implemented. |
void |
removeUserPermissions(String group)
Not implemented. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SubvertedPermissionManager()
Method Detail |
---|
public void addPermission(int permissionsId, org.ofbiz.core.entity.GenericValue scheme, String group, String securityType)
addPermission
in interface PermissionManager
permissionsId
- Permissions value. E.g. See Permissions.ADMINISTER
scheme
- If null permission is global otherwise it is added to the schemegroup
- Used for e.g. group namesecurityType
- e.g. GroupDropdown.DESCpublic Collection<Project> getProjectObjects(int permissionId, com.atlassian.crowd.embedded.api.User user)
PermissionManager
getProjectObjects
in interface PermissionManager
permissionId
- must NOT be a global permissionuser
- user
Project
objectspublic Collection<org.ofbiz.core.entity.GenericValue> getProjects(int permissionId, com.atlassian.crowd.embedded.api.User user, org.ofbiz.core.entity.GenericValue category)
getProjects
in interface PermissionManager
permissionId
- ignored.user
- ignored.category
- the category for which to get projects.
public boolean hasProjects(int permissionId, com.atlassian.crowd.embedded.api.User user)
hasProjects
in interface PermissionManager
permissionId
- ignored.user
- ignored.
public void removeGroupPermissions(String group)
removeGroupPermissions
in interface PermissionManager
group
- The name of the group that needs to be removed, must NOT be null and must be a real grouppublic void removeUserPermissions(String group)
removeUserPermissions
in interface PermissionManager
group
- username of the user whose permissions are to be removedpublic Collection<com.atlassian.crowd.embedded.api.Group> getAllGroups(int permType, Project project)
getAllGroups
in interface PermissionManager
permType
- permission idproject
- project from which to retrieve groups
public Collection<Group> getAllGroups(int permType, org.ofbiz.core.entity.GenericValue entity)
getAllGroups
in interface PermissionManager
permType
- permission identity
- project to retrieve groups from
public boolean hasPermission(int permissionType, com.atlassian.crowd.embedded.api.User u)
hasPermission
in interface PermissionManager
permissionType
- ignoredu
- ignored
GlobalPermissionManager.hasPermission(int, User)
public boolean hasPermission(int permissionsId, org.ofbiz.core.entity.GenericValue entity, com.atlassian.crowd.embedded.api.User u)
hasPermission
in interface PermissionManager
permissionsId
- ignoredentity
- ignoredu
- ignored
public boolean hasPermission(int permissionsId, Issue issue, com.atlassian.crowd.embedded.api.User u)
hasPermission
in interface PermissionManager
permissionsId
- ignoredissue
- ignoredu
- ignored
public boolean hasPermission(int permissionsId, Project project, com.atlassian.crowd.embedded.api.User user)
hasPermission
in interface PermissionManager
permissionsId
- ignoredproject
- ignoreduser
- ignored
public boolean hasPermission(int permissionsId, Project project, com.atlassian.crowd.embedded.api.User user, boolean issueCreation)
hasPermission
in interface PermissionManager
permissionsId
- ignoredproject
- ignoreduser
- ignoredissueCreation
- ignored
public boolean hasPermission(int permissionsId, org.ofbiz.core.entity.GenericValue project, com.atlassian.crowd.embedded.api.User u, boolean issueCreation)
hasPermission
in interface PermissionManager
permissionsId
- ignoredproject
- ignoredu
- ignoredissueCreation
- ignored
public final boolean hasPermission(int permissionsId, User user)
PermissionManager
hasPermission
in interface PermissionManager
permissionsId
- permission iduser
- user, can be null - anonymous user
GlobalPermissionManager.hasPermission(int, User)
public final boolean hasPermission(int permissionsId, org.ofbiz.core.entity.GenericValue entity, User u)
PermissionManager
hasPermission
in interface PermissionManager
permissionsId
- Not a global permissionentity
- Not null. Must be either an issue or project.u
- User object, possibly null if JIRA is accessed anonymously
public final boolean hasPermission(int permissionsId, Issue entity, User u)
PermissionManager
PermissionManager.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.
hasPermission
in interface PermissionManager
permissionsId
- Not a global permissionentity
- Not null.u
- User object, possibly null if JIRA is accessed anonymously
public final boolean hasPermission(int permissionsId, Project project, User user)
PermissionManager
hasPermission
in interface PermissionManager
permissionsId
- A non-global permission, i.e. a permission that is granted via a project contextproject
- The project that is the context of the permission check.user
- The person to perform the permission check for
public final boolean hasPermission(int permissionsId, Project project, User user, boolean issueCreation)
PermissionManager
hasPermission
in interface PermissionManager
permissionsId
- A non-global permission, i.e. a permission that is granted via a project contextproject
- The project that is the context of the permission check.user
- The person to perform the permission check forissueCreation
- Whether this permission is being checked during issue creation
public final boolean hasPermission(int permissionsId, org.ofbiz.core.entity.GenericValue project, User u, boolean issueCreation)
PermissionManager
PermissionManager.hasPermission(int,org.ofbiz.core.entity.GenericValue,User)
except
the entity is a project GenericValue
.
hasPermission
in interface PermissionManager
permissionsId
- Not a global permissionproject
- Not null.u
- User object, possibly null if JIRA is accessed anonymouslyissueCreation
- Whether this permission is being checked during issue creation
public final boolean hasProjects(int permissionId, User user)
PermissionManager
hasProjects
in interface PermissionManager
permissionId
- must NOT be a global permissionuser
- user being checked
public final Collection<org.ofbiz.core.entity.GenericValue> getProjects(int permissionId, User user)
getProjects
in interface PermissionManager
permissionId
- unused.user
- unused.
public final Collection<org.ofbiz.core.entity.GenericValue> getProjects(int permissionId, com.atlassian.crowd.embedded.api.User user)
PermissionManager
getProjects
in interface PermissionManager
permissionId
- must NOT be a global permissionuser
- user
GenericValue
objectspublic final Collection<Project> getProjectObjects(int permissionId, User user)
PermissionManager
getProjectObjects
in interface PermissionManager
permissionId
- must NOT be a global permissionuser
- user
Project
objectspublic final Collection<org.ofbiz.core.entity.GenericValue> getProjects(int permissionId, User user, org.ofbiz.core.entity.GenericValue category)
PermissionManager
getProjects
in interface PermissionManager
permissionId
- permission iduser
- usercategory
- GenericValue representing category
GenericValue
objects
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |