From 0fd5da172e33e187f8fb5d0a67c58c33719a103b Mon Sep 17 00:00:00 2001 From: jakedt Date: Thu, 10 Apr 2014 15:51:39 -0400 Subject: [PATCH] Fix the super user default config. Slight style tweaks to the super user permission implementation. --- auth/permissions.py | 5 +++-- config.py | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/auth/permissions.py b/auth/permissions.py index a55fc3115..b2e7fe784 100644 --- a/auth/permissions.py +++ b/auth/permissions.py @@ -22,7 +22,7 @@ _TeamTypeNeed = namedtuple('teamwideneed', ['type', 'orgname', 'teamname', 'role _TeamNeed = partial(_TeamTypeNeed, 'orgteam') _UserTypeNeed = namedtuple('userspecificneed', ['type', 'username', 'role']) _UserNeed = partial(_UserTypeNeed, 'user') -_SuperUserNeed = partial(namedtuple('superuserneed', ['type']), '_superuser') +_SuperUserNeed = partial(namedtuple('superuserneed', ['type']), 'superuser') REPO_ROLES = [None, 'read', 'write', 'admin'] @@ -90,7 +90,8 @@ class QuayDeferredPermissionUser(Identity): user_object = model.get_user(self.id) # Add the superuser need, if applicable. - if user_object.username is not None and user_object.username in app.config.get('SUPER_USERS', []): + if (user_object.username is not None and + user_object.username in app.config.get('SUPER_USERS', [])): self.provides.add(_SuperUserNeed()) # Add the user specific permissions, only for non-oauth permission diff --git a/config.py b/config.py index b1d21fbf8..4df58d5ea 100644 --- a/config.py +++ b/config.py @@ -124,8 +124,8 @@ class DefaultConfig(object): STATUS_TAGS[tag_name] = tag_svg.read() - # Super user config. Note: This MUST BE None for the default config. - SUPER_USERS = None + # Super user config. Note: This MUST BE an empty list for the default config. + SUPER_USERS = [] # Feature Flag: Whether billing is required. FEATURE_BILLING = True @@ -137,7 +137,7 @@ class DefaultConfig(object): FEATURE_GITHUB_LOGIN = True # Feature flag, whether to enable olark chat - FEATURE_OLARK_CHAT = True + FEATURE_OLARK_CHAT = False # Feature Flag: Whether super users are supported. FEATURE_SUPER_USERS = False