com.atlassian.jira.security
Class SubvertedPermissionManager

java.lang.Object
  extended by com.atlassian.jira.security.SubvertedPermissionManager
All Implemented Interfaces:
JiraManager, PermissionManager

public class SubvertedPermissionManager
extends Object
implements PermissionManager

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 getAllGroups(int permType, org.ofbiz.core.entity.GenericValue entity)
          Not implemented.
 Collection getProjects(int permType, User user)
          Simply returns all projects.
 Collection getProjects(int permissionId, 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.
 boolean hasPermission(int permissionsId, org.ofbiz.core.entity.GenericValue entity, User u)
          Always returns true.
 boolean hasPermission(int permissionsId, org.ofbiz.core.entity.GenericValue project, User u, boolean issueCreation)
          Always return true.
 boolean hasPermission(int permissionsId, Issue issue, User u)
          Always returns true.
 boolean hasPermission(int permissionsId, Project project, User user)
          Always return true.
 boolean hasPermission(int permissionsId, Project project, User user, boolean issueCreation)
          Always return true.
 boolean hasPermission(int permissionType, User u)
          Always returns true.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubvertedPermissionManager

public SubvertedPermissionManager()
Method Detail

addPermission

public void addPermission(int permissionsId,
                          org.ofbiz.core.entity.GenericValue scheme,
                          String group,
                          String securityType)
Not implemented.

Specified by:
addPermission in interface PermissionManager
Parameters:
permissionsId - Permissions value. E.g. See Permissions.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

getProjects

public Collection getProjects(int permType,
                              User user)
Simply returns all projects.

Specified by:
getProjects in interface PermissionManager
Parameters:
permType - unused.
user - unused.
Returns:
all the projects.

getProjects

public Collection getProjects(int permissionId,
                              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.

Specified by:
getProjects in interface PermissionManager
Parameters:
permissionId - ignored.
user - ignored.
category - the category for which to get projects.
Returns:
the projects.

hasProjects

public boolean hasProjects(int permissionId,
                           User user)
Returns true if there are any projects at all.

Specified by:
hasProjects in interface PermissionManager
Parameters:
permissionId - ignored.
user - ignored.
Returns:
true if there are any projects.

removeGroupPermissions

public void removeGroupPermissions(String group)
Not implemented.

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

removeUserPermissions

public void removeUserPermissions(String group)
Not implemented.

Specified by:
removeUserPermissions in interface PermissionManager
Parameters:
group - username of the user whose permissions are to be removed

getAllGroups

public Collection getAllGroups(int permType,
                               org.ofbiz.core.entity.GenericValue entity)
                        throws Exception
Not implemented.

Specified by:
getAllGroups in interface PermissionManager
Parameters:
permType - permission id
entity - project to retireve groups from
Returns:
a collection of
Throws:
Exception

hasPermission

public boolean hasPermission(int permissionType,
                             User u)
Always returns true.

Specified by:
hasPermission in interface PermissionManager
Parameters:
permissionType - ignored
u - ignored
Returns:
true
See Also:
GlobalPermissionManager.hasPermission(int, com.opensymphony.user.User)

hasPermission

public boolean hasPermission(int permissionsId,
                             org.ofbiz.core.entity.GenericValue entity,
                             User u)
Always returns true.

Specified by:
hasPermission in interface PermissionManager
Parameters:
permissionsId - ignored
entity - ignored
u - ignored
Returns:
true

hasPermission

public boolean hasPermission(int permissionsId,
                             Issue issue,
                             User u)
Always returns true.

Specified by:
hasPermission in interface PermissionManager
Parameters:
permissionsId - ignored
issue - ignored
u - ignored
Returns:
true

hasPermission

public boolean hasPermission(int permissionsId,
                             Project project,
                             User user)
Always return true.

Specified by:
hasPermission in interface PermissionManager
Parameters:
permissionsId - ignored
project - ignored
user - ignored
Returns:
true

hasPermission

public boolean hasPermission(int permissionsId,
                             Project project,
                             User user,
                             boolean issueCreation)
Always return true.

Specified by:
hasPermission in interface PermissionManager
Parameters:
permissionsId - ignored
project - ignored
user - ignored
issueCreation - ignored
Returns:
true

hasPermission

public boolean hasPermission(int permissionsId,
                             org.ofbiz.core.entity.GenericValue project,
                             User u,
                             boolean issueCreation)
Always return true.

Specified by:
hasPermission in interface PermissionManager
Parameters:
permissionsId - ignored
project - ignored
u - ignored
issueCreation - ignored
Returns:
true


Copyright © 2002-2008 Atlassian. All Rights Reserved.