com.michelin.cio.hudson.plugins.rolestrategy
Class Role

java.lang.Object
  extended by com.michelin.cio.hudson.plugins.rolestrategy.Role
All Implemented Interfaces:
java.lang.Comparable

public final class Role
extends java.lang.Object
implements java.lang.Comparable

Class representing a role, which holds a set of Permissions.

Author:
Thomas Maurel

Method Summary
 int compareTo(java.lang.Object o)
          Compare role names.
 java.lang.String getName()
          Getter for the role name.
 java.util.regex.Pattern getPattern()
          Getter for the regexp pattern.
 java.util.Set<hudson.security.Permission> getPermissions()
          Getter for the Permissions set.
 java.lang.Boolean hasAnyPermission(java.util.Set<hudson.security.Permission> permissions)
          Checks if the role holds any of the given Permission.
 java.lang.Boolean hasPermission(hudson.security.Permission permission)
          Checks if the role holds the given Permission.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public final java.lang.String getName()
Getter for the role name.

Returns:
The role name

getPattern

public final java.util.regex.Pattern getPattern()
Getter for the regexp pattern.

Returns:
The pattern associated to the role

getPermissions

public final java.util.Set<hudson.security.Permission> getPermissions()
Getter for the Permissions set.

Returns:
Permissions set

hasPermission

public final java.lang.Boolean hasPermission(hudson.security.Permission permission)
Checks if the role holds the given Permission.

Parameters:
permission - The permission you want to check
Returns:
True if the role holds this permission

hasAnyPermission

public final java.lang.Boolean hasAnyPermission(java.util.Set<hudson.security.Permission> permissions)
Checks if the role holds any of the given Permission.

Parameters:
permissions - A Permissions set
Returns:
True if the role holds any of the given Permissions

compareTo

public int compareTo(java.lang.Object o)
Compare role names.

Used to sort the set.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - The object you want to compare this instance to
Returns:
Comparison of role names


Copyright © 2010. All Rights Reserved.