~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to doc/dev/faq.rst

  • Committer: Matt Giuca
  • Date: 2010-02-11 03:17:12 UTC
  • Revision ID: matt.giuca@gmail.com-20100211031712-79c74lgh3mj7507s
docs: Tour of IVLE: Added lecturer tour (complete).

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
   variables than code running outside. It will be missing a lot of data, and
51
51
   will contain some user-specific data.
52
52
 
53
 
... restrict permission to different views?
54
 
-------------------------------------------
55
 
 
56
 
In all views derived from ``BaseView`` the ``authorize`` function is called to 
57
 
check if a user has access to a particular file. Often this is simply a check 
58
 
to ensure that the user is logged in (the value of 'user' is not None), but 
59
 
may be more complex such as checking if a user has a password hash set (to 
60
 
prevent clobbering of external auth) or checking if a user has permission to 
61
 
edit an ``Offering`` object.
62
 
 
63
53
Database
64
54
========
65
55
 
145
135
    store.add(user)
146
136
    store.commit()
147
137
 
148
 
... modify user capabilities or privileges?
149
 
-------------------------------------------
150
 
 
151
 
User privileges are set by the ``get_permissions`` functions in 
152
 
``ivle/database.py``. Permissions are highly granular and can be set on almost 
153
 
every object in the database.
154
 
 
155
 
Most permissions are set on the ``Offering`` level with ``ProjectSet``, 
156
 
``Project`` and ``Worksheet`` simply delegating the check to ``Offering``.  
157
 
Since ``Exercise`` may be shared between multiple ``Offerings``, the 
158
 
permissions are calculated from the users active enrollments. Other objects 
159
 
such as ``User`` may only be modified by the user or an admin. If a user is 
160
 
not logged in (user is None) then they will typically receive no privileges at 
161
 
all.
162
 
 
163
138
Where do I find...
164
139
------------------
165
140