Commit e32bb625 by Juho Juopperi

small changes

1 parent c14d376b
...@@ -31,15 +31,16 @@ public class SessionHandler { ...@@ -31,15 +31,16 @@ public class SessionHandler {
} }
public boolean hasPermission(String target, String permission) { public boolean hasPermission(String target, String permission) {
RolePermission perm = RolePermission.READ; RolePermission perm = null;
if (permission.equals("write")) { if (permission.equalsIgnoreCase("read")) {
perm = RolePermission.READ;
} else if (permission.equals("write")) {
perm = RolePermission.WRITE; perm = RolePermission.WRITE;
} else if (permission.equals("execute")) { } else if (permission.equals("execute")) {
perm = RolePermission.EXECUTE; perm = RolePermission.EXECUTE;
} }
return hasPermission(target, perm); return hasPermission(target, perm);
} }
public boolean hasPermission(String target, RolePermission permission) { public boolean hasPermission(String target, RolePermission permission) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!