## If you want the terms of service displayed, you can uncomment this
# show_tos = true
+user_privilege_scheme= "uploader,commenter,reporter"
[storage:queuestore]
base_dir = %(here)s/user_dev/media/queue
results = hook_runall("auth_create_user", register_form)
return results[0]
-
def extra_validation(register_form):
from mediagoblin.auth.tools import basic_extra_validation
user = auth.create_user(register_form)
# give the user the default privileges
- default_privileges = [
- Privilege.query.filter(Privilege.privilege_name==u'commenter').first(),
- Privilege.query.filter(Privilege.privilege_name==u'uploader').first(),
- Privilege.query.filter(Privilege.privilege_name==u'reporter').first()]
- user.all_privileges += default_privileges
+ user.all_privileges += get_default_privileges(user)
user.save()
# log the user in
return None
+def get_default_privileges(user):
+ instance_privilege_scheme = mg_globals.app_config['user_privilege_scheme']
+ default_privileges = [Privilege.query.filter(
+ Privilege.privilege_name==privilege_name).first()
+ for privilege_name in instance_privilege_scheme.split(',')]
+ default_privileges = [privilege for privilege in default_privileges if not privilege == None]
+
+ return default_privileges
def check_login_simple(username, password):
user = auth.get_user(username=username)
# Max file size (in Mb)
max_file_size = integer(default=None)
+# Privilege scheme
+user_privilege_scheme = string(default="")
+
[jinja2]
# Jinja2 supports more directives than the minimum required by mediagoblin.
# This setting allows users creating custom templates to specify a list of