java.lang.Object | |
↳ | com.atlassian.bitbucket.web.conditions.AbstractPermissionCondition |
Known Direct Subclasses |
An abstract base class for creating permission-based conditions. The permission will be parsed from the
initialisation context
and validated by this base class. Derived classes then implement
shouldDisplay(Map)
to make the desired check using the PermissionService
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | CONTEXT_PARAM | ||||||||||
String | PERMISSION | Defines the key from the initialisation context under which the permission name is expected
to be set. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
permissionService | Allows derived implementations to access the PermissionService . |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new
AbstractPermissionCondition which will perform checks using the specified
PermissionService . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Retrieves the
initialised permission. | |||||||||||
Retrieves the
permission from the context and stores it . | |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Retrieves a string describing the required permission type.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.atlassian.plugin.web.Condition
|
Defines the key from the initialisation context
under which the permission name is expected
to be set.
Allows derived implementations to access the PermissionService
.
Constructs a new AbstractPermissionCondition
which will perform checks using the specified
PermissionService
. The provided global
flag is used during initialisation
,
to validate the global
flag of the parsed permission.
permissionService | the service to use when performing the permission check |
---|---|
global | true if the initialised permission is required to be global; otherwise,
false to required a non-global permission
|
Retrieves the initialised
permission.
Retrieves the permission
from the context and stores it
. The
global
flag of the parsed permission is validated against the flag set when
the instance was constructed.
params | the initialisation context |
---|
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.
|
---|
Retrieves a string describing the required permission type.
"global"
or "non-global
depending on the flag set during construction