Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Hydra::AccessControls::Permission#to_hash for better compatibility... #146

Merged

Conversation

dchandekstark
Copy link
Member

... with hash-based permissions

Added unit test module for Hydra::AccessControls::Permission

If merged, hydra-head version should be incremented to 6.5.0.

@jcoyne
Copy link
Member

jcoyne commented Feb 4, 2014

Better compatibility with what? Can you be more specific? It doesn't look like any behavior actually changed here, did it?

@dchandekstark
Copy link
Member Author

@jcoyne in HH 6.4 the #permissions= setter (and #permissions_attributes=) does not work with the data that the #permissions getter returns -- i.e., an array of Permission objects. This could be patched in more than one way. Specifically the setter blows up now b/c tries to call #with_indifferent_access on each "permission" object in the collection. At least with this method you can do:

obj1.permissions_attributes = obj2.permissions.collect { |p| p.to_hash }

I brought this general issue up on hydra-tech a while back - the issue of the HH 6.4 permissions getter/setter mismatch - but it got no traction.

@jcoyne
Copy link
Member

jcoyne commented Feb 4, 2014

@dchandekstark that sounds good. Shouldn't you be testing to_hash though?

@dchandekstark
Copy link
Member Author

@jcoyne I guess you're right. It gets exercised by using #[] in the tests, but probably should have an explicit test. I will update the PR.

…ity with hash-based permissions

Added unit test module for Hydra::AccessControls::Permission
jcoyne added a commit that referenced this pull request Feb 4, 2014
Added Hydra::AccessControls::Permission#to_hash for better compatibility...
@jcoyne jcoyne merged commit cfbd3a7 into samvera:6-4-stable Feb 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants