sandstorm / NeosAcl

14 stars 8 forks source link

BUGFIX: fix check for allowed workspaces #35

Closed Benjamin-K closed 2 years ago

Benjamin-K commented 2 years ago

What I did

Previously the check for workspaces was done by adding ( isInWorkspace("workspaceA") || isInWorkspace("workspaceB") ) to the generated policy. But isInWorkspace() requires an array of all valid workspaces.

I fixed the issue by generating isInWorkspace(["workspaceA", "workspaceB"]) for the policy. I also always added the "live" workspace to this check as otherwise users with this role won't be able to change anything that is published to live even if they are in one of the restricted workspaces. To restrict a user from publishing to live, simply don't add the (parent) role "LivePublisher".

How to verify it

Checklist

This also fixes #34

skurfuerst commented 2 years ago

very nice, thanks so much :)