Skip to content
Snippets Groups Projects
Commit b73b2199 authored by scariot's avatar scariot
Browse files

fixed authentication, fixed method returning all collections when user_can_edit? is true

parent 42307916
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@ module PublisherController
end
def show_all_collections
render json: ::UserPolicy::Scope.new(current_user, @publisher, Collection).resolve
render json: ::UserPolicy::Scope.new(current_user, @publisher, Collection).resolve.where(owner: @publisher)
end
def show_liked_learning_objects
......
......@@ -31,10 +31,8 @@ module PublisherPolicy
def resolve
if user.nil?
scope.where(privacy: 'public')
elsif user_can_edit?
elsif user_can_edit? || record == user
scope.all
elsif record == user
scope.where(owner: user)
else
scope.where(privacy: 'public')
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment