public class PermissionRequest extends Object
Note that this class does not validate the relationship between the permission
and
the resource
that it holds. The APIs accepting instances of permission requests are
responsible for verifying whether given permission request is valid.
Modifier and Type | Class and Description |
---|---|
static class |
PermissionRequest.Builder |
Modifier | Constructor and Description |
---|---|
protected |
PermissionRequest(PermissionRequest.Builder builder) |
Modifier and Type | Method and Description |
---|---|
Permission |
getPermission() |
Object |
getResource()
Resource to which the
permission should apply. |
<T> T |
getResourceAs(Class<T> resourceType)
Resource to which the
permission should apply, as a client-specified instance of
resourceType . |
ApplicationUser |
getUser() |
protected PermissionRequest(PermissionRequest.Builder builder)
@Nonnull public Permission getPermission()
global permission
,
or a resource permission to the specified resource
@Nullable public Object getResource()
permission
should apply. This could be a domain object (e.g.
project or repository), as well as an ID.permission
should apply, or null
if this request
does not concern any particular resource (which should be the case for
global permissions
)@Nullable public <T> T getResourceAs(@Nonnull Class<T> resourceType)
permission
should apply, as a client-specified instance of
resourceType
.T
- resource typeresourceType
- the type of the resource to cast topermission
should apply, or null
if this request
does not concern any particular resource (which should be the case for
global permissions
)ClassCastException
- if the resource is not an instance of the expected resourceType
@Nullable public ApplicationUser getUser()
permission
, or null
if this request does
not concern any particular userCopyright © 2019 Atlassian. All rights reserved.