Skip to content

Commit

Permalink
code refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
dsuren1 committed Feb 19, 2025
1 parent d745379 commit b15c92a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions web/client/selectors/styleeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,16 @@ export const canEditSelector = (state) => get(state, 'styleeditor.canEdit', fals
* @return {bool}
*/
export const canEditStyleSelector = (state) => {
const canEdit = canEditSelector(state);
if (canEdit) return canEdit;
const allowedRoles = editingAllowedRolesSelector(state);
const allowedGroups = editingAllowedGroupsSelector(state);
const canEdit = canEditSelector(state);
const _isSameOrigin = isSameOrigin(getUpdatedLayer(state), styleServiceSelector(state));
const isAllowed = isUserAllowedSelectorCreator({
allowedRoles,
allowedGroups
})(state);
return canEdit || (isAllowed && _isSameOrigin);
return isAllowed && _isSameOrigin;
};
/**
* selects geometry type of selected layer from state
Expand Down

0 comments on commit b15c92a

Please sign in to comment.