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

Users email now showing to editors

parent 60574807
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
# along with portalmec. If not, see <http://www.gnu.org/licenses/>. # along with portalmec. If not, see <http://www.gnu.org/licenses/>.
class UserSerializer < ActiveModel::Serializer class UserSerializer < ActiveModel::Serializer
cache key: 'user', expires_in: 4.hours, except: [ :complained, :followed ] cache key: 'user', expires_in: 4.hours, except: [:email, :complained, :followed ]
def complained def complained
object.complained? current_user object.complained? current_user
...@@ -62,7 +62,7 @@ class UserSerializer < ActiveModel::Serializer ...@@ -62,7 +62,7 @@ class UserSerializer < ActiveModel::Serializer
end end
def is_current_user? def is_current_user?
(!current_user.nil?)&&(object.id == current_user.id || current_user.is_admin?) (!current_user.nil?)&&(object.id == current_user.id || current_user.is_admin? || current_user.roles.exists?(Role.find_by_name('editor').id))
end end
attributes \ attributes \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment