a little nicer wrt pep8
[sfa.git] / docs / pythondoc-rights.html
1 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
2 <html>
3 <head>
4 <meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
5 <title>The rights Module</title>
6 </head>
7 <body>
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:
11
12 Right - represents a single right
13
14 RightList - represents a list of rights
15
16 A right may allow several different operations. For example, the &quot;info&quot; right
17 allows &quot;listslices&quot;, &quot;listcomponentresources&quot;, etc.</p>
18 <dl>
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>
20 <dd>
21 <p>privilege_table is a list of priviliges and what operations are allowed
22 per privilege.</p>
23 </dd>
24 <dt><b>Right(kind)</b> (class) [<a href='#rights.Right-class'>#</a>]</dt>
25 <dd>
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>
28 </dd>
29 <dt><b>RightList(string=None)</b> (class) [<a href='#rights.RightList-class'>#</a>]</dt>
30 <dd>
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>
33 </dd>
34 </dl>
35 <h2><a id='rights.Right-class' name='rights.Right-class'>The Right Class</a></h2>
36 <dl>
37 <dt><b>Right(kind)</b> (class) [<a href='#rights.Right-class'>#</a>]</dt>
38 <dd>
39 <p>The Right class represents a single privilege.</p>
40 </dd>
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>
42 <dd>
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>
45 <dl>
46 <dt><i>op_name</i></dt>
47 <dd>
48 is a string naming the operation. For example &quot;listslices&quot;.</dd>
49 </dl><br />
50 </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>
52 <dd>
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
55 by this object.</p>
56 <dl>
57 <dt><i>child</i></dt>
58 <dd>
59 is a Right object describing the child right</dd>
60 </dl><br />
61 </dd>
62 </dl>
63 <h2><a id='rights.RightList-class' name='rights.RightList-class'>The RightList Class</a></h2>
64 <dl>
65 <dt><b>RightList(string=None)</b> (class) [<a href='#rights.RightList-class'>#</a>]</dt>
66 <dd>
67 <p>A RightList object represents a list of privileges.</p>
68 </dd>
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>
70 <dd>
71 <p>Add a right to this list</p>
72 <dl>
73 <dt><i>right</i></dt>
74 <dd>
75 is either a Right object or a string describing the right</dd>
76 </dl><br />
77 </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>
79 <dd>
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
82 list.</p>
83 <dl>
84 <dt><i>op_name</i></dt>
85 <dd>
86 is an operation to check, for example &quot;listslices&quot;</dd>
87 </dl><br />
88 </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>
90 <dd>
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>
95 <dl>
96 <dt><i>child</i></dt>
97 <dd>
98 is a rightlist object describing the child</dd>
99 </dl><br />
100 </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>
102 <dd>
103 <p>Load the rightlist object from a string</p>
104 </dd>
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>
106 <dd>
107 <p>Save the rightlist object to a string. It is saved in the format of a
108 comma-separated list.</p>
109 </dd>
110 </dl>
111 </body></html>