Skip to content
Snippets Groups Projects
Commit 21c3d426 authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

Merge branch 'master' into MigrationToDSpace6-3

parents aafeefdc 71ad311f
No related branches found
No related tags found
No related merge requests found
...@@ -54,17 +54,21 @@ class UserSerializer < ActiveModel::Serializer ...@@ -54,17 +54,21 @@ class UserSerializer < ActiveModel::Serializer
end end
def cpf def cpf
object.cpf if is_current_user? object.cpf if is_current_user? || is_supervisor?
end end
def school def school
object.school if is_current_user? object.school if is_current_user? || is_supervisor?
end end
def is_current_user? def is_current_user?
(!current_user.nil?)&&(object.id == current_user.id || current_user.can_edit?) (!current_user.nil?)&&(object.id == current_user.id || current_user.can_edit?)
end end
def is_supervisor?
!current_user.nil? && current_user.is_supervisor?
end
attributes \ attributes \
:id, :id,
:email, :email,
......
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