__author__ = 'Pavel Simakov ([email protected])' import collections import config from common import utils from common import users from models import MemcacheManager from models import RoleDAO GCB_ADMIN_LIST = config.ConfigProperty( 'gcb_admin_user_emails', str, ( 'A list of email addresses for super-admin users. ' 'WARNING! Super-admin users have the highest level of access to your ' 'Google App Engine instance and to all data about all courses and ' 'students within that instance. Be very careful when modifying this ' 'property. ' 'Syntax: Entries may be separated with any combination of ' 'tabs, spaces, commas, or newlines. Existing values using "[" and ' '"]" around email addresses continues to be supported. ' 'Regular expressions are not supported.'), '', multiline=True) KEY_COURSE = 'course' KEY_ADMIN_USER_EMAILS = 'admin_user_emails' GCB_WHITELISTED_USERS = config.ConfigProperty( 'gcb_user_whitelist', str, ( 'A list of email addresses of users allowed access to courses. ' 'If this is blank, site-wide user whitelisting is disabled. ' 'Access to courses is also implicitly granted to super admins and ' 'course admins, so you need not repeat those names here. '
__author__ = 'Pavel Simakov ([email protected])' import collections import config import messages from common import utils from common import users from models import MemcacheManager from models import RoleDAO GCB_ADMIN_LIST = config.ConfigProperty( 'gcb_admin_user_emails', str, messages.SITE_SETTINGS_SITE_ADMIN_EMAILS, '', label='Site Admin Emails', multiline=True) KEY_COURSE = 'course' KEY_ADMIN_USER_EMAILS = 'admin_user_emails' GCB_WHITELISTED_USERS = config.ConfigProperty('gcb_user_whitelist', str, messages.SITE_SETTINGS_WHITELIST, '', label='Whitelist', multiline=True) Permission = collections.namedtuple('Permission', ['name', 'description'])
# limitations under the License. """Manages mapping of users to roles and roles to privileges.""" __author__ = 'Pavel Simakov ([email protected])' import config from google.appengine.api import users GCB_ADMIN_LIST = config.ConfigProperty( 'gcb_admin_user_emails', str, ( 'A list of email addresses for super-admin users. ' 'WARNING! Super-admin users have the highest level of access to your ' 'Google App Engine instance and to all data about all courses and ' 'students within that instance. Be very careful when modifying this ' 'property. Syntax: Surround each email address with [ and ]; for ' 'example, [[email protected]]. Separate the entries with either a new ' 'line or a space. Do not use regular expressions.'), '', multiline=True) KEY_COURSE = 'course' KEY_ADMIN_USER_EMAILS = 'admin_user_emails' class Roles(object): """A class that provides information about user roles.""" @classmethod def is_direct_super_admin(cls): """Checks if current user is a super admin, without delegation."""