-
Notifications
You must be signed in to change notification settings - Fork 124
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
reindexing a record will clear acls and permission groups #6324
Conversation
@@ -13,7 +13,7 @@ module PermissionIndexer | |||
def to_solr | |||
super.tap do |index_document| | |||
config = Hydra.config.permissions | |||
permissions = Hyrax::PermissionManager.new(resource: resource) | |||
permissions = resource.permission_manager || Hyrax::PermissionManager.new(resource: resource) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think if this is right, just resource.permission_manager
should do the trick (it builds one exactly like the ||
path if it's not present, and the second branch should be unreachable as is).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
The change to PermissionIndexer is good, but the ACL#save change results in problems. Currently, reindexing an unpersisted resource is going to result in blank fields for those supplied by AccessControl objects. This is because |
@dlpierce I'm not following you. Are you saying that previous to this change calling index on an unsaved model "works" but leaves the acl fields blank, but removing |
remove || that will never be reached
26767b7
to
432a0d1
Compare
I think my findings here: https://gist.github.com/jeremyf/90f6c6ae81f9c4596b666237d5da2931?permalink_comment_id=4846614#gistcomment-4846614 are likely what @dlpierce is referring to. |
@dlpierce you were 100% right here. Jeremy and I fixed it a different way that I think gets us both wins. |
Summary
When writing specs I noticed my records would be correct in the index but then they would get updated and suddenly they would loose their read_groups / edit_groups / edit_users / read_users. Also if you save an ACL list and then index the record again at any point it will loose the visibility setting.
Guidance for testing, such as acceptance criteria or new user interface behaviors:
@samvera/hyrax-code-reviewers