Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

Commit

Permalink
Block reader users access to users forms
Browse files Browse the repository at this point in the history
Readers users will now only be available of seeing their own edit form.
Fixes #1064
  • Loading branch information
Edmundo Alvarez committed Jan 22, 2015
1 parent 5ec4954 commit 068a775
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/controllers/UsersController.java
Expand Up @@ -107,6 +107,9 @@ public Result show(String username) {
}

public Result newUserForm() {
if (!Permissions.isPermitted(RestPermissions.USERS_CREATE)) {
return redirect(routes.StartpageController.redirect());
}
BreadcrumbList bc = breadcrumbs();
bc.addCrumb("New", routes.UsersController.newUserForm());

Expand All @@ -130,6 +133,9 @@ public Result newUserForm() {
}

public Result editUserForm(String username) {
if (!Permissions.isPermitted(RestPermissions.USERS_EDIT, username)) {
return redirect(routes.StartpageController.redirect());
}
BreadcrumbList bc = breadcrumbs();
bc.addCrumb("Edit " + username, routes.UsersController.editUserForm(username));

Expand Down

0 comments on commit 068a775

Please sign in to comment.