com.atlassian.bitbucket.repository.ref.restriction.RefRestrictionService |
A service that manages restrictions to refs.
Repository admin permissions are required for all operations unless specified.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Get a
RefRestriction by its ID. | |||||||||||
Check if the current user has permission to perform an action on a ref or collection of MinimalRef refs.
| |||||||||||
Match a proposed list of
refChanges (optionally taking into consideration a specific user who
is about to perform them) with any restriction(s) that would prevent the change. | |||||||||||
Remove a
RefRestriction by its ID. | |||||||||||
Search for
restrictions based on the RestrictionSearchRequest . | |||||||||||
Sets a restriction based on the
SetRestrictionRequest . | |||||||||||
Sets all the restrictions specified by the provided
requests . |
Get a RefRestriction
by its ID.
id | the ID associated with the RefRestriction |
---|
RefRestriction
or null
if not found
Check if the current user has permission to perform an action on a ref or collection of MinimalRef refs. This method does not require any permissions and can be called by any user.
request | specifies which branches and which access rights to check for |
---|
true
if the user can take the action specified in request
, false
otherwise
Match a proposed list of refChanges
(optionally taking into consideration a specific user who
is about to perform them) with any restriction(s) that would prevent the change. The results are returned as a
Multimap that matches up each disallowed refChange
to any restriction(s) that match it.
This allows a caller to discover for any arbitrary set of refChanges
not only whether they
will be prevented by restrictions but also which specific restriction(s) apply to each individual
refChange
.
If the FAST_FORWARD_ONLY
restriction type is included in the request, then the fromHash
and toHash
of any matching
refChanges
will be checked to determine if the ref change is a fast-forward-only change or
would attempt to rewrite history (and therefore be prevented). This requires fromHash
and toHash
to be valid for the specified repository, or com.atlassian.bitbucket.scm.CommandFailedException will be
thrown.
request | specifies the repository, types , refChanges , and
(optionally) a user for the proposed change. |
---|
RefRestriction
(s) (if any) that apply to each
refChange
specified in the input. If the refChanges
would not be
prevented by any restriction, then an empty Multimap is returned.if FAST_FORWARD_ONLY restrictions are checked
and fromHash and toHash are invalid for the specified repository. |
Remove a RefRestriction
by its ID.
id | the ID associated with the RefRestriction |
---|
true
if the RefRestriction
was deleted, false
otherwise
Search for restrictions
based on the RestrictionSearchRequest
.
request | the RestrictionSearchRequest which specifies the restrictions to search for |
---|---|
pageRequest | the PageRequest which specifies the page to return |
Page
of restrictions
Sets a restriction based on the SetRestrictionRequest
.
If the same RefRestriction
already exists it will be overwritten.
request | the SetRestrictionRequest which specifies the restriction to be set |
---|
RefRestriction
Sets all the restrictions specified by the provided requests
.
requests | a list of requests which specify the restrictions to be set |
---|
restrictions