Commit 21b29ecb authored by Piotr Gawron's avatar Piotr Gawron
Browse files

user should be able to access project when have manage project privilege

parent b5e2fb3e
......@@ -262,10 +262,12 @@ public class ProjectService implements IProjectService {
@Override
public Project getProjectByProjectId(String name, AuthenticationToken token) throws UserAccessException {
Project result = projectDao.getProjectByProjectId(name);
if (!userService.userHasPrivilege(token, PrivilegeType.VIEW_PROJECT, result)) {
throw new UserAccessException("User cannot access project");
if (userService.userHasPrivilege(token, PrivilegeType.VIEW_PROJECT, result)) {
return result;
} else if (userService.userHasPrivilege(token, PrivilegeType.ADD_MAP)) {
return result;
}
return result;
throw new UserAccessException("User cannot access project");
}
@Override
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment