com.atlassian.jira.web.bean
Class PermissionCheckBean

java.lang.Object
  extended by com.atlassian.jira.web.bean.PermissionCheckBean

public class PermissionCheckBean
extends Object

This bean class allows for "concise" permission checks to be made. Its therefore useful in jsp/velocity contexts for check that the user has permission to see something and hence the UI can be adjusted appropriately.

Since:
v3.12

Constructor Summary
PermissionCheckBean()
           
PermissionCheckBean(JiraAuthenticationContext authContext, PermissionManager permissionManager)
           
 
Method Summary
 boolean isAdmin()
          Tells whether the configured user (if any) has admin permission.
 boolean isIssueVisible(Issue issue)
          Returns true if the user has permission to Permissions.BROWSE the issue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermissionCheckBean

public PermissionCheckBean(JiraAuthenticationContext authContext,
                           PermissionManager permissionManager)

PermissionCheckBean

public PermissionCheckBean()
Method Detail

isIssueVisible

public boolean isIssueVisible(Issue issue)
Returns true if the user has permission to Permissions.BROWSE the issue

Parameters:
issue - the issue in question to be checked
Returns:
true if the user has permission to Permissions.BROWSE the issue.
Throws:
IllegalArgumentException - if the issue object is nhull

isAdmin

public boolean isAdmin()
Tells whether the configured user (if any) has admin permission.

Returns:
true only if the user is an administrator.


Copyright © 2002-2014 Atlassian. All Rights Reserved.