Added Roles & Capabilities page to user settings
Thanks @fsiddi for helping with the explanatory text.
This commit is contained in:
@@ -35,3 +35,10 @@ def profile():
|
|||||||
flash(message)
|
flash(message)
|
||||||
|
|
||||||
return render_template('users/settings/profile.html', form=form, title='profile')
|
return render_template('users/settings/profile.html', form=form, title='profile')
|
||||||
|
|
||||||
|
|
||||||
|
@blueprint.route('/roles')
|
||||||
|
@login_required
|
||||||
|
def roles():
|
||||||
|
"""Show roles and capabilties of the current user."""
|
||||||
|
return render_template('users/settings/roles.html', title='roles')
|
||||||
|
@@ -17,6 +17,13 @@
|
|||||||
i.pi-vcard
|
i.pi-vcard
|
||||||
| Profile
|
| Profile
|
||||||
| {% endblock settings_sidebar_menu %}
|
| {% endblock settings_sidebar_menu %}
|
||||||
|
| {% block settings_sidebar_menu_bottom %}
|
||||||
|
a(class="{% if title == 'roles' %}active{% endif %}",
|
||||||
|
href="{{ url_for('settings.roles') }}")
|
||||||
|
li
|
||||||
|
i.pi-cog
|
||||||
|
| Roles & Capabilities
|
||||||
|
| {% endblock settings_sidebar_menu_bottom %}
|
||||||
| {% endblock %}
|
| {% endblock %}
|
||||||
|
|
||||||
#settings-container
|
#settings-container
|
||||||
|
1
src/templates/users/settings/roles.pug
Normal file
1
src/templates/users/settings/roles.pug
Normal file
@@ -0,0 +1 @@
|
|||||||
|
| {% extends 'users/settings/roles_base.html' %}
|
35
src/templates/users/settings/roles_base.pug
Normal file
35
src/templates/users/settings/roles_base.pug
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
| {% extends 'users/settings/page.html' %}
|
||||||
|
| {% block settings_page_title %}Roles & Capabilities{% endblock %}
|
||||||
|
| {% block settings_page_content %}
|
||||||
|
| {% block explanation %}
|
||||||
|
p.
|
||||||
|
Here is some behind-the-scenes info! In order to define what you can do on this website, we rely
|
||||||
|
on a system of #[em roles] and #[em capabilities]. For example, every website user "can-read" a
|
||||||
|
post, but only editors "can-write" and "can-edit" it.
|
||||||
|
|
||||||
|
p.
|
||||||
|
Your roles are determined by multiple factors, such as being part of an organisation, being
|
||||||
|
subscribed to a service, etc… Your capabilities are determined by the roles you have.
|
||||||
|
|
||||||
|
p.
|
||||||
|
If the website does not work as expected (for example you received permission-related errors),
|
||||||
|
it is often useful to mention what your Roles and Capabilities are when asking for support.
|
||||||
|
| {% endblock explanation %}
|
||||||
|
|
||||||
|
dl.dl-horizontal
|
||||||
|
dt Your Roles
|
||||||
|
| {% for role in current_user.roles | sort %}
|
||||||
|
dd {{ role }}
|
||||||
|
| {% else %}
|
||||||
|
dd Your account has no roles assigned, which means you have a free account.
|
||||||
|
| {% endfor %}
|
||||||
|
|
||||||
|
dl.dl-horizontal
|
||||||
|
dt Your Capabilities
|
||||||
|
| {% for cap in current_user.capabilities | sort %}
|
||||||
|
dd {{ cap }}
|
||||||
|
| {% else %}
|
||||||
|
dd Your account has no capabilities assigned.
|
||||||
|
| {% endfor %}
|
||||||
|
|
||||||
|
| {% endblock %}
|
Reference in New Issue
Block a user