Skip to content

Instantly share code, notes, and snippets.

@elrayle
Last active September 1, 2017 15:22
Show Gist options
  • Save elrayle/5840132c7b888d2243f2bca26102afdc to your computer and use it in GitHub Desktop.
Save elrayle/5840132c7b888d2243f2bca26102afdc to your computer and use it in GitHub Desktop.
add this file at... /app/services/hyrax/collection_types/permissions_service.rb
module Hyrax
module CollectionTypes
class PermissionsService
# @api public
#
# Get a list of collection types that a user can create
#
# @param user [User] the user that will be creating a collection (default: current_user)
# @return [Array<Hyrax::CollectionType>] array of collection types the user can create
def self.can_create_collection_types(user: current_user)
# Stubbed to return all types. Implement according to issue #1582
return Hyrax::CollectionType.all if user.present? # condition test added to allow paramter to be present
[]
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment