Package hudson.security
Class PermissionGroup
- java.lang.Object
-
- hudson.security.PermissionGroup
-
- All Implemented Interfaces:
Comparable<PermissionGroup>,Iterable<Permission>
public final class PermissionGroup extends Object implements Iterable<Permission>, Comparable<PermissionGroup>
Group ofPermissions that share the sameowner. Sortable by the owner class name.
-
-
Constructor Summary
Constructors Constructor Description PermissionGroup(Class owner, org.jvnet.localizer.Localizable title)Both creates a registers a new permission group.PermissionGroup(String id, Class owner, org.jvnet.localizer.Localizable title)Both creates a registers a new permission group.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(PermissionGroup that)booleanequals(Object o)Permissionfind(String name)Finds a permission that has the given name.static PermissionGroupget(Class owner)Gets thePermissionGroupwhoseowneris the given class.static List<PermissionGroup>getAll()Returns all thePermissionGroups available in the system.StringgetId()Gets ID of the permission group.StringgetOwnerClassName()List<Permission>getPermissions()Lists up all the permissions in this group.inthashCode()booleanhasPermissionContainedBy(PermissionScope scope)Iterator<Permission>iterator()intsize()StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
owner
@NonNull public final Class owner
-
title
public final org.jvnet.localizer.Localizable title
Human readable title of this permission group. This should be short.
-
-
Constructor Detail
-
PermissionGroup
public PermissionGroup(@NonNull Class owner, org.jvnet.localizer.Localizable title) throws IllegalStateExceptionBoth creates a registers a new permission group.- Parameters:
owner- setsownertitle- setstitle- Throws:
IllegalStateException- if this group was already registered
-
PermissionGroup
public PermissionGroup(String id, @NonNull Class owner, org.jvnet.localizer.Localizable title) throws IllegalStateException
Both creates a registers a new permission group.- Parameters:
owner- setsownertitle- setstitle- Throws:
IllegalStateException- if this group was already registered- Since:
- 2.127
-
-
Method Detail
-
getId
public String getId()
Gets ID of the permission group.- Returns:
- Non-localizable ID of the permission group.
-
getOwnerClassName
public String getOwnerClassName()
-
iterator
public Iterator<Permission> iterator()
- Specified by:
iteratorin interfaceIterable<Permission>
-
getPermissions
public List<Permission> getPermissions()
Lists up all the permissions in this group.
-
hasPermissionContainedBy
public boolean hasPermissionContainedBy(PermissionScope scope)
-
find
public Permission find(String name)
Finds a permission that has the given name.
-
compareTo
public int compareTo(PermissionGroup that)
- Specified by:
compareToin interfaceComparable<PermissionGroup>
-
size
public int size()
-
getAll
public static List<PermissionGroup> getAll()
Returns all thePermissionGroups available in the system.- Returns:
- always non-null. Read-only.
-
get
@CheckForNull public static PermissionGroup get(Class owner)
Gets thePermissionGroupwhoseowneris the given class.- Returns:
- null if not found.
-
-