Last active
September 1, 2017 15:22
-
-
Save elrayle/5840132c7b888d2243f2bca26102afdc to your computer and use it in GitHub Desktop.
add this file at... /app/services/hyrax/collection_types/permissions_service.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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