1 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
4 <meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
5 <title>The rights Module</title>
8 <h1>The rights Module</h1>
9 <p>This Module implements rights and lists of rights for the Geni wrapper. Rights
10 are implemented by two classes:
12 Right - represents a single right
14 RightList - represents a list of rights
16 A right may allow several different operations. For example, the "info" right
17 allows "listslices", "listcomponentresources", etc.</p>
19 <dt><a id='rights.privilege_table-variable' name='rights.privilege_table-variable'><b>privilege_table</b></a> (variable) [<a href='#rights.privilege_table-variable'>#</a>]</dt>
21 <p>privilege_table is a list of priviliges and what operations are allowed
24 <dt><b>Right(kind)</b> (class) [<a href='#rights.Right-class'>#</a>]</dt>
26 <p>The Right class represents a single privilege.</p>
27 <p>For more information about this class, see <a href='#rights.Right-class'><i>The Right Class</i></a>.</p>
29 <dt><b>RightList(string=None)</b> (class) [<a href='#rights.RightList-class'>#</a>]</dt>
31 <p>A RightList object represents a list of privileges.</p>
32 <p>For more information about this class, see <a href='#rights.RightList-class'><i>The RightList Class</i></a>.</p>
35 <h2><a id='rights.Right-class' name='rights.Right-class'>The Right Class</a></h2>
37 <dt><b>Right(kind)</b> (class) [<a href='#rights.Right-class'>#</a>]</dt>
39 <p>The Right class represents a single privilege.</p>
41 <dt><a id='rights.Right.can_perform-method' name='rights.Right.can_perform-method'><b>can_perform(op_name)</b></a> [<a href='#rights.Right.can_perform-method'>#</a>]</dt>
43 <p>Test to see if this right object is allowed to perform an operation.
44 Returns True if the operation is allowed, False otherwise.</p>
46 <dt><i>op_name</i></dt>
48 is a string naming the operation. For example "listslices".</dd>
51 <dt><a id='rights.Right.is_superset-method' name='rights.Right.is_superset-method'><b>is_superset(child)</b></a> [<a href='#rights.Right.is_superset-method'>#</a>]</dt>
53 <p>Test to see if this right is a superset of a child right. A right is a
54 superset if every operating that is allowed by the child is also allowed
59 is a Right object describing the child right</dd>
63 <h2><a id='rights.RightList-class' name='rights.RightList-class'>The RightList Class</a></h2>
65 <dt><b>RightList(string=None)</b> (class) [<a href='#rights.RightList-class'>#</a>]</dt>
67 <p>A RightList object represents a list of privileges.</p>
69 <dt><a id='rights.RightList.add-method' name='rights.RightList.add-method'><b>add(right)</b></a> [<a href='#rights.RightList.add-method'>#</a>]</dt>
71 <p>Add a right to this list</p>
75 is either a Right object or a string describing the right</dd>
78 <dt><a id='rights.RightList.can_perform-method' name='rights.RightList.can_perform-method'><b>can_perform(op_name)</b></a> [<a href='#rights.RightList.can_perform-method'>#</a>]</dt>
80 <p>Check to see if some right in this list allows an operation. This is
81 done by evaluating the can_perform function of each operation in the
84 <dt><i>op_name</i></dt>
86 is an operation to check, for example "listslices"</dd>
89 <dt><a id='rights.RightList.is_superset-method' name='rights.RightList.is_superset-method'><b>is_superset(child)</b></a> [<a href='#rights.RightList.is_superset-method'>#</a>]</dt>
91 <p>Check to see if all of the rights in this rightlist are a superset
92 of all the rights in a child rightlist. A rightlist is a superset
93 if there is no operation in the child rightlist that cannot be
94 performed in the parent rightlist.</p>
98 is a rightlist object describing the child</dd>
101 <dt><a id='rights.RightList.load_from_string-method' name='rights.RightList.load_from_string-method'><b>load_from_string(string)</b></a> [<a href='#rights.RightList.load_from_string-method'>#</a>]</dt>
103 <p>Load the rightlist object from a string</p>
105 <dt><a id='rights.RightList.save_to_string-method' name='rights.RightList.save_to_string-method'><b>save_to_string()</b></a> [<a href='#rights.RightList.save_to_string-method'>#</a>]</dt>
107 <p>Save the rightlist object to a string. It is saved in the format of a
108 comma-separated list.</p>