Package com.google.gerrit.server.project
Class PermissionCollection
- java.lang.Object
-
- com.google.gerrit.server.project.PermissionCollection
-
public class PermissionCollection extends Object
Effective permissions applied to a reference in a project.A collection may be user specific if a matching
AccessSection
uses "${username}" in its name. The permissions granted in that section may only be granted to the username that appears in the reference name, and also only if the user is a member of the relevant group.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PermissionCollection.Factory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterable<Map.Entry<String,List<PermissionRule>>>
getDeclaredPermissions()
Obtain all declared permission rules that match the reference.List<PermissionRule>
getPermission(String permissionName)
Obtain all permission rules for a given type of permission.boolean
isUserSpecific()
-
-
-
Method Detail
-
isUserSpecific
public boolean isUserSpecific()
- Returns:
- true if a "${username}" pattern might need to be expanded to build this collection, making the results user specific.
-
getPermission
public List<PermissionRule> getPermission(String permissionName)
Obtain all permission rules for a given type of permission.- Parameters:
permissionName
- type of permission.- Returns:
- all rules that apply to this reference, for any group. Never null; the empty list is returned when there are no rules for the requested permission name.
-
getDeclaredPermissions
public Iterable<Map.Entry<String,List<PermissionRule>>> getDeclaredPermissions()
Obtain all declared permission rules that match the reference.- Returns:
- all rules. The collection will iterate a permission if it was declared in the project
configuration, either directly or inherited. If the project owner did not use a known
permission (for example
Permission.FORGE_SERVER
, then it will not be represented in the result even ifgetPermission(String)
returns an empty list for the same permission.
-
-