read anon user role from config, remove reference to public role (#1878)
* read anon user role from configuration, add anon user role as 'Public' to testing configuration * apply suggestions
This commit is contained in:
parent
3e6f90cf72
commit
ea8e6634d6
|
|
@ -205,7 +205,8 @@ def check_ownership(obj, raise_if_false=True):
|
|||
|
||||
def get_user_roles():
|
||||
if g.user.is_anonymous():
|
||||
return [appbuilder.sm.find_role('Public')]
|
||||
public_role = config.get('AUTH_ROLE_PUBLIC')
|
||||
return [appbuilder.sm.find_role(public_role)] if public_role else []
|
||||
return g.user.roles
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ CSRF_ENABLED = False
|
|||
SECRET_KEY = 'thisismyscretkey'
|
||||
WTF_CSRF_ENABLED = False
|
||||
PUBLIC_ROLE_LIKE_GAMMA = True
|
||||
|
||||
AUTH_ROLE_PUBLIC = 'Public'
|
||||
|
||||
class CeleryConfig(object):
|
||||
BROKER_URL = 'sqla+sqlite:///' + SQL_CELERY_DB_FILE_PATH
|
||||
|
|
|
|||
Loading…
Reference in New Issue