~0x44/nova/bug838466

« back to all changes in this revision

Viewing changes to nova/context.py

  • Committer: Dan Prince
  • Date: 2011-08-30 02:27:28 UTC
  • mto: This revision was merged to the branch mainline in revision 1509.
  • Revision ID: dan.prince@rackspace.com-20110830022728-1vhch5h9c9s1e4s4
Update RequestContext so that it correctly sets self.is_admin from the
roles array. Additionally add a bit of code to ignore case as well.

Resolves issues when accessing admin API's w/ Keystone.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
        self.roles = roles or []
39
39
        self.is_admin = is_admin
40
40
        if self.is_admin is None:
41
 
            self.admin = 'admin' in self.roles
 
41
            self.is_admin = 'admin' in [x.lower() for x in self.roles]
42
42
        self.read_deleted = read_deleted
43
43
        self.remote_address = remote_address
44
44
        if not timestamp: