public class

HasGlobalPermissionUrlReadingCondition

extends SimpleUrlReadingCondition
java.lang.Object
   ↳ com.atlassian.plugin.webresource.condition.SimpleUrlReadingCondition
     ↳ com.atlassian.bitbucket.web.conditions.HasGlobalPermissionUrlReadingCondition

Class Overview

Verifies that the current user has a global permission as an com.atlassian.plugin.webresource.condition.UrlReadingCondition. This condition should be used only in web-resources when required to be combined with other com.atlassian.plugin.webresource.condition.UrlReadingConditions.

 <condition class="com.atlassian.bitbucket.web.conditions.HasGlobalPermissionUrlReadingCondition">
     <param name="permission">ADMIN</param>
 </condition>
 

Summary

Public Constructors
HasGlobalPermissionUrlReadingCondition(PermissionService permissionService)
Constructs a new HasGlobalPermissionUrlReadingCondition which will perform checks using the specified PermissionService.
Public Methods
void init(Map<StringString> params)
Retrieves the #PERMISSION permission from the context.
Protected Methods
boolean isConditionTrue()
String queryKey()
[Expand]
Inherited Methods
From class com.atlassian.plugin.webresource.condition.SimpleUrlReadingCondition
From class java.lang.Object
From interface com.atlassian.plugin.webresource.condition.UrlReadingCondition
From interface com.atlassian.webresource.api.prebake.DimensionAwareUrlReadingCondition

Public Constructors

public HasGlobalPermissionUrlReadingCondition (PermissionService permissionService)

Constructs a new HasGlobalPermissionUrlReadingCondition which will perform checks using the specified PermissionService.

Parameters
permissionService the service to use when performing the permission check

Public Methods

public void init (Map<StringString> params)

Retrieves the #PERMISSION permission from the context. The global flag of the parsed permission is validated to ensure the Permission is global.

Parameters
params the initialisation context
Throws
PluginParseException Thrown if no #PERMISSION permission is set, or if the set value is not a valid Permission, or the permission's global flag does not match the required value.

Protected Methods

protected boolean isConditionTrue ()

protected String queryKey ()