The rights Module

This Module implements rights and lists of rights for the Geni wrapper. Rights are implemented by two classes: Right - represents a single right RightList - represents a list of rights A right may allow several different operations. For example, the "info" right allows "listslices", "listcomponentresources", etc.

privilege_table (variable) [#]

privilege_table is a list of priviliges and what operations are allowed per privilege.

Right(kind) (class) [#]

The Right class represents a single privilege.

For more information about this class, see The Right Class.

RightList(string=None) (class) [#]

A RightList object represents a list of privileges.

For more information about this class, see The RightList Class.

The Right Class

Right(kind) (class) [#]

The Right class represents a single privilege.

can_perform(op_name) [#]

Test to see if this right object is allowed to perform an operation. Returns True if the operation is allowed, False otherwise.

op_name
is a string naming the operation. For example "listslices".

is_superset(child) [#]

Test to see if this right is a superset of a child right. A right is a superset if every operating that is allowed by the child is also allowed by this object.

child
is a Right object describing the child right

The RightList Class

RightList(string=None) (class) [#]

A RightList object represents a list of privileges.

add(right) [#]

Add a right to this list

right
is either a Right object or a string describing the right

can_perform(op_name) [#]

Check to see if some right in this list allows an operation. This is done by evaluating the can_perform function of each operation in the list.

op_name
is an operation to check, for example "listslices"

is_superset(child) [#]

Check to see if all of the rights in this rightlist are a superset of all the rights in a child rightlist. A rightlist is a superset if there is no operation in the child rightlist that cannot be performed in the parent rightlist.

child
is a rightlist object describing the child

load_from_string(string) [#]

Load the rightlist object from a string

save_to_string() [#]

Save the rightlist object to a string. It is saved in the format of a comma-separated list.