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

« back to all changes in this revision

Viewing changes to lib/common/studpath.py

  • Committer: mattgiuca
  • Date: 2008-02-19 07:12:38 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:506
dispatch.__init__, dispatch.request, cgirequest:
    Removed "username" attribute from Request objects altogether.
    Use req.user.login instead.
consoleservice, userservice, fileservice, debuginfo, studpath:
    Replaced use of "req.username" with "req.user.login".
Yay, refactor complete!

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
    return len(props) > 0
115
115
 
116
116
def authorize(req):
117
 
    """Given a request, checks whether req.username is allowed to
 
117
    """Given a request, checks whether req.user is allowed to
118
118
    access req.path. Returns None on authorization success. Raises
119
119
    HTTP_FORBIDDEN on failure.
120
120
 
129
129
        req.throw_error(req.HTTP_FORBIDDEN)
130
130
 
131
131
    (owner, _) = util.split_path(urlpath)
132
 
    if req.username != owner:
 
132
    if req.user.login != owner:
133
133
        req.throw_error(req.HTTP_FORBIDDEN)
134
134
 
135
135
def authorize_public(req):