Skip to content

Commit

Permalink
update: 📝 added page editor role (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
arunasd463 authored Feb 23, 2024
1 parent e2198ac commit f5a7b59
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ public class UserGroupServiceImpl implements UserGroupSerivce {
private final String messageType = "User Groups";
private static final String roleAdmin = "ROLE_ADMIN";
private static final String species = "species";
private static final String ROLE_PAGE_EDITOR = "ROLE_PAGE_EDITOR";

@Override
public UserGroup fetchByGroupId(Long id) {
Expand Down Expand Up @@ -2017,9 +2018,8 @@ public Boolean enableEdit(HttpServletRequest request, Long userGroupId) {
JSONArray roles = (JSONArray) profile.getAttribute("roles");
Boolean isFounder = ugMemberService.checkFounderRole(userId, userGroupId);
Boolean isModerator = ugMemberService.checkModeratorRole(userId, userGroupId);
if (roles.contains(roleAdmin) || Boolean.TRUE.equals(isFounder) || Boolean.TRUE.equals(isModerator))
return true;
return false;
return (roles.contains(roleAdmin) || roles.contains(ROLE_PAGE_EDITOR) || Boolean.TRUE.equals(isFounder)
|| Boolean.TRUE.equals(isModerator));
}

@Override
Expand Down

0 comments on commit f5a7b59

Please sign in to comment.