Skip to content
Snippets Groups Projects
Commit 7789dc50 authored by Giovanne Marcelo's avatar Giovanne Marcelo
Browse files

Merge branch 'fix-collection_item_serializer' into 'master'

fix show

See merge request !340
parents 31ad71e4 6a7fbe96
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,7 @@ class LearningObjectPolicy < ApplicationPolicy
end
def show?
return record if record.published? || user.is_admin?
return record if record.published? || user.try(:is_admin?)
return record if user == record.publisher
## TODO: falta verificar se o +record.publisher+ é uma instituição e +user+ faz parte
end
......@@ -44,7 +44,7 @@ class LearningObjectPolicy < ApplicationPolicy
def index?
record
end
def add_object?
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