Skip to content
Snippets Groups Projects
Commit 7a90003d authored by Mateus Rambo Strey's avatar Mateus Rambo Strey
Browse files

fix delete learning objects from collections

parent 6abc3870
No related branches found
No related tags found
No related merge requests found
......@@ -209,8 +209,12 @@ class CollectionsController < ApplicationController
end
def authorize_action
@collection ||= Collection.new
authorize @collection
if !@collections.nil?
@collections.each { |c| authorize c }
else
@collection ||= Collection.new
authorize @collection
end
end
end
......@@ -3,8 +3,6 @@ class CollectionPolicy < ApplicationPolicy
include FollowablePolicy
class Scope < Scope
def initialize (user, user_id, scope)
@user = user
@user_id = user_id
......@@ -12,7 +10,6 @@ class CollectionPolicy < ApplicationPolicy
end
def resolve
if @user.try(:id) == @user_id || @user.try(:is_admin?)
scope.all
else
......@@ -21,7 +18,6 @@ class CollectionPolicy < ApplicationPolicy
end
end
def create?
record if user_exists?
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