Skip to content

Commit

Permalink
Merge pull request #2924 from samvera/2388_limit_deprecation
Browse files Browse the repository at this point in the history
limit the exposure of the permissions_attributes deprecation warning for collections
  • Loading branch information
Thomas Johnson authored Apr 18, 2018
2 parents b9e7f7a + 2f13f01 commit af708f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/hyrax/dashboard/collections_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,10 @@ def collection_params

def extract_old_style_permission_attributes(attributes)
# TODO: REMOVE in 3.0 - part of deprecation of permission attributes
Deprecation.warn(self, "passing in permissions with a new collection is deprecated and will be removed from Hyrax 3.0 ()") # TODO: elr - add alternative in ()
permissions = attributes.delete("permissions_attributes")
return [] unless permissions
Deprecation.warn(self, "Passing in permissions_attributes parameter with a new collection is deprecated and support will be removed from Hyrax 3.0. " \
"Use Hyrax::PermissionTemplate instead to grant Manage, Deposit, or View access.")
participants = []
permissions.each do |p|
access = access(p)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
post :create, params: {
collection: collection_attrs.merge(
visibility: 'open',
# TODO: Tests with old approach to sharing a collection which is deprecated and
# will be removed in 3.0. New approach creates a PermissionTemplate with
# source_id = the collection's id.
permissions_attributes: [{ type: 'person',
name: 'archivist1',
access: 'edit' }]
Expand Down

0 comments on commit af708f1

Please sign in to comment.