Class PermissionTemplate
java.lang.Object
com.michelin.cio.hudson.plugins.rolestrategy.PermissionTemplate
- All Implemented Interfaces:
Comparable<PermissionTemplate>
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public class PermissionTemplate
extends Object
implements Comparable<PermissionTemplate>
Holds a set of permissions for the role generator.
-
Constructor Summary
ConstructorsConstructorDescriptionPermissionTemplate(String name, Set<String> permissions) Create a new PermissionTemplate.PermissionTemplate(Set<Permission> permissions, String name) Create a new PermissionTemplate. -
Method Summary
Modifier and TypeMethodDescriptionintbooleangetName()inthashCode()hasPermission(Permission permission) Checks if the role holds the givenPermission.booleanisUsed()Checks whether the template is used by one or more roles.
-
Constructor Details
-
PermissionTemplate
Create a new PermissionTemplate.- Parameters:
name- the name of the templatepermissions- the set of permissions of this template
-
PermissionTemplate
Create a new PermissionTemplate.- Parameters:
name- the name of the templatepermissions- the set of permissions of this template
-
-
Method Details
-
isUsed
public boolean isUsed()Checks whether the template is used by one or more roles.- Returns:
- true when template is used.
-
getName
-
getPermissions
-
hasPermission
Checks if the role holds the givenPermission.- Parameters:
permission- The permission you want to check- Returns:
- True if the role holds this permission
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<PermissionTemplate>
-