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

« back to all changes in this revision

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

  • Committer: Matt Giuca
  • Date: 2010-02-24 03:19:35 UTC
  • Revision ID: matt.giuca@gmail.com-20100224031935-zxfw8aj8iir8epff
Breadcrumb now shows user's nickname on user page only if the current user is authorised to view that user. Otherwise, shows login. (Previously showed the nickname always, which is a minor information disclosure). Fixes Launchpad bug #493919.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
    @property
39
39
    def text(self):
40
 
        return self.context.nick
 
40
        perms = self.context.get_permissions(self.req.user, self.req.config)
 
41
        # Show nickname iff current user has permission to view this user
 
42
        # (Else, show just the login name)
 
43
        if 'view' in perms:
 
44
            return self.context.nick
 
45
        else:
 
46
            return self.context.login
41
47
 
42
48
    @property
43
49
    def extra_breadcrumbs_before(self):