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

« back to all changes in this revision

Viewing changes to ivle/webapp/admin/user.py

Merge from new-dispatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
# Author: Matt Giuca, Will Grant
19
19
 
20
 
from ivle.webapp.base.rest import JSONRESTView
 
20
from ivle.webapp.base.rest import JSONRESTView, require_permission
21
21
from ivle.webapp.base.xhtml import XHTMLView
22
22
from ivle.webapp.base.plugins import ViewPlugin, MediaPlugin
23
23
from ivle.webapp.errors import NotFound, Unauthorized
42
42
        if self.context is None:
43
43
            raise NotFound()
44
44
 
 
45
    @require_permission('view')
45
46
    def GET(self, req):
46
47
        # XXX Check Caps
47
48
        user = ivle.util.object_to_dict(user_fields_list, self.context)
53
54
        user['local_password'] = self.context.passhash is not None
54
55
        return user
55
56
 
 
57
    @require_permission('edit')
56
58
    def PATCH(self, req, data):
57
 
        # XXX Check Caps
58
59
        # XXX Admins can set extra fields
59
60
        # Note: Cannot change password here (use change_password named op)
60
61