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 ofPermission
s 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 int
compareTo(PermissionGroup that)
boolean
equals(Object o)
Permission
find(String name)
Finds a permission that has the given name.static PermissionGroup
get(Class owner)
Gets thePermissionGroup
whoseowner
is the given class.static List<PermissionGroup>
getAll()
Returns all thePermissionGroup
s available in the system.String
getId()
Gets ID of the permission group.String
getOwnerClassName()
List<Permission>
getPermissions()
Lists up all the permissions in this group.int
hashCode()
boolean
hasPermissionContainedBy(PermissionScope scope)
Iterator<Permission>
iterator()
int
size()
String
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 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 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 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:
iterator
in 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:
compareTo
in interfaceComparable<PermissionGroup>
-
size
public int size()
-
getAll
public static List<PermissionGroup> getAll()
Returns all thePermissionGroup
s available in the system.- Returns:
- always non-null. Read-only.
-
get
@CheckForNull public static PermissionGroup get(Class owner)
Gets thePermissionGroup
whoseowner
is the given class.- Returns:
- null if not found.
-
-