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 of
Permission
s that share the same owner
.
Sortable by the owner class name.-
Field Summary
-
Constructor Summary
ConstructorDescriptionPermissionGroup
(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
Modifier and TypeMethodDescriptionint
compareTo
(PermissionGroup that) boolean
Finds a permission that has the given name.static PermissionGroup
Gets thePermissionGroup
whoseowner
is the given class.static List<PermissionGroup>
getAll()
Returns all thePermissionGroup
s available in the system.getId()
Gets ID of the permission group.Lists up all the permissions in this group.int
hashCode()
boolean
iterator()
int
size()
toString()
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 Details
-
owner
-
title
public final org.jvnet.localizer.Localizable titleHuman readable title of this permission group. This should be short.
-
-
Constructor Details
-
PermissionGroup
public PermissionGroup(@NonNull Class owner, org.jvnet.localizer.Localizable title) throws IllegalStateException Both creates a registers a new permission group.- Parameters:
owner
- setsowner
title
- 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
- setsowner
title
- setstitle
- Throws:
IllegalStateException
- if this group was already registered- Since:
- 2.127
-
-
Method Details
-
getId
Gets ID of the permission group.- Returns:
- Non-localizable ID of the permission group.
-
getOwnerClassName
-
iterator
- Specified by:
iterator
in interfaceIterable<Permission>
-
getPermissions
Lists up all the permissions in this group. -
hasPermissionContainedBy
-
find
Finds a permission that has the given name. -
compareTo
- Specified by:
compareTo
in interfaceComparable<PermissionGroup>
-
equals
-
hashCode
public int hashCode() -
size
public int size() -
toString
-
getAll
Returns all thePermissionGroup
s available in the system.- Returns:
- always non-null. Read-only.
-
get
Gets thePermissionGroup
whoseowner
is the given class.- Returns:
- null if not found.
-