hydra-head icon indicating copy to clipboard operation
hydra-head copied to clipboard

Permissions attributes are incorrectly updated when multiple access levels are defined.

Open jonathandixon opened this issue 8 years ago • 0 comments

Descriptive summary

10.5.0

When a user or group has multiple access permissions on an object, the permissions are incorrectly updated when saving permission_attributes.

Rationale

If the permissions on an object are:

And the permissions attributes are set to the same the result is two permissions both with read access.

Expected behavior

Should maintain both access levels for the user or group.

Actual behavior

The first access level is overwritten by the access level of the last permission passed to permission_attributes=.

Steps to reproduce the behavior

fs = FileSet.create
fs.permissions_attributes = [{:name=>"[email protected]", :type=>"person", :access=>"edit"}, {:name=>"[email protected]", :type=>"person", :access=>"read"}]
fs.save

fs.permissions_attributes = [{:name=>"[email protected]", :type=>"person", :access=>"edit"}, {:name=>"[email protected]", :type=>"person", :access=>"read"}]
fs.save

jonathandixon avatar Oct 25 '17 16:10 jonathandixon