Skip to content

Commit

Permalink
Fix guest users being able to create dashboards
Browse files Browse the repository at this point in the history
Former-commit-id: 3a4ddcc
  • Loading branch information
kizniche committed May 29, 2020
1 parent 1c5c8bb commit 2a891cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ WARNING: There are changes with this version that may cause issues with your cur
- Fix hostname display on login page
- Fix missing blank line check for LCDs with 8 lines ([#771](https://github.com/kizniche/mycodo/issues/771))
- Fix unset user groups when executing shell commands
- Fix guest users being able to create dashboards

### Features

Expand Down
4 changes: 3 additions & 1 deletion mycodo/mycodo_flask/routes_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,9 @@ def page_dashboard_default():
@blueprint.route('/dashboard-add', methods=('GET', 'POST'))
@flask_login.login_required
def page_dashboard_add():
"""Load default dashboard"""
"""Add a dashboard"""
if not utils_general.user_has_permission('edit_controllers'):
return redirect(url_for('routes_general.home'))
dashboard_id = utils_dashboard.dashboard_add()
return redirect(url_for(
'routes_page.page_dashboard', dashboard_id=dashboard_id))
Expand Down

0 comments on commit 2a891cb

Please sign in to comment.