| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public class Rights extends Object implements Cloneable
The Rights class represents the set of rights for an authentication identifier (for instance, a user or a group).
A right is represented by the Rights.Right
inner class.
A set of standard rights are predefined (see RFC 2086). Most folder implementations are expected to support these rights. Some implementations may also support site-defined rights.
The following code sample illustrates how to examine your rights for a folder.
Rights rights = folder.myRights(); // Check if I can write this folder if (rights.contains(Rights.Right.WRITE)) System.out.println("Can write folder"); // Now give Joe all my rights, except the ability to write the folder rights.remove(Rights.Right.WRITE); ACL acl = new ACL("joe", rights); folder.setACL(acl);
Nested Class Summary | |
---|---|
static class |
This inner class represents an individual right. |
Constructor Summary | |
---|---|
Rights() Construct an empty Rights object. |
|
Construct a Rights object initialized with the given rights. |
|
Rights(Rights.Right right) Construct a Rights object initialized with the given right. |
|
Construct a Rights object initialized with the given rights. |
Method Summary | |
---|---|
void |
Add all the rights in the given Rights object to this Rights object. |
void |
add(Rights.Right right) Add the specified right to this Rights object. |
Object |
clone() Returns a clone of this Rights object. |
boolean |
Check whether all the rights in the specified Rights object are present in this Rights object. |
boolean |
contains(Rights.Right right) Check whether the specified right is present in this Rights object. |
boolean |
Check whether the two Rights objects are equal. |
Rights.Right[] |
Return all the rights in this Rights object. |
int |
hashCode() Compute a hash code for this Rights object. |
void |
Remove all rights in the given Rights object from this Rights object. |
void |
remove(Rights.Right right) Remove the specified right from this Rights object. |
String |
toString() |
Constructor Detail |
---|
public Rights()
public Rights(Rights rights)
rights
- the rights for initializationpublic Rights(Rights.Right right)
right
- the right for initializationpublic Rights(String rights)
rights
- the rights for initializationMethod Detail |
---|
public void add(Rights rights)
rights
- Rights objectpublic void add(Rights.Right right)
right
- the right to addpublic Object clone()
clone
in class Object
public boolean contains(Rights rights)
rights
public boolean contains(Rights.Right right)
right
public boolean equals(Object obj)
equals
in class Object
obj
public Rights.Right[] getRights()
public int hashCode()
hashCode
in class Object
public void remove(Rights rights)
rights
- the rights to be removedpublic void remove(Rights.Right right)
right
- the right to be removedpublic String toString()
toString
in class Object
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |