public class HasGlobalPermissionUrlReadingCondition
extends com.atlassian.plugin.webresource.condition.SimpleUrlReadingCondition
UrlReadingCondition
.
This condition should be used only in web-resources when required to be combined with other UrlReadingCondition
s.
<condition class="com.atlassian.bitbucket.web.conditions.HasGlobalPermissionUrlReadingCondition">
<param name="permission">ADMIN</param>
</condition>
Constructor and Description |
---|
HasGlobalPermissionUrlReadingCondition(com.atlassian.bitbucket.permission.PermissionService permissionService)
Constructs a new
HasGlobalPermissionUrlReadingCondition which will perform checks using the specified
PermissionService . |
Modifier and Type | Method and Description |
---|---|
void |
init(Map<String,String> params)
Retrieves the
permission from the context. |
protected boolean |
isConditionTrue() |
protected String |
queryKey() |
public HasGlobalPermissionUrlReadingCondition(com.atlassian.bitbucket.permission.PermissionService permissionService)
HasGlobalPermissionUrlReadingCondition
which will perform checks using the specified
PermissionService
.permissionService
- the service to use when performing the permission checkpublic void init(Map<String,String> params) throws com.atlassian.plugin.PluginParseException
permission
from the context. The global
flag of the
parsed permission is validated to ensure the Permission
is global.init
in interface com.atlassian.plugin.webresource.condition.UrlReadingCondition
init
in class com.atlassian.plugin.webresource.condition.SimpleUrlReadingCondition
params
- the initialisation contextcom.atlassian.plugin.PluginParseException
- Thrown if no 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 boolean isConditionTrue()
isConditionTrue
in class com.atlassian.plugin.webresource.condition.SimpleUrlReadingCondition
protected String queryKey()
queryKey
in class com.atlassian.plugin.webresource.condition.SimpleUrlReadingCondition
Copyright © 2021 Atlassian. All rights reserved.