adds link to send message from my activity

This commit is contained in:
rgarcia
2016-06-01 21:01:24 +02:00
parent f5375e813d
commit 6e4ed0b895
5 changed files with 58 additions and 10 deletions

View File

@@ -3,6 +3,7 @@ class UsersController < ApplicationController
load_and_authorize_resource
helper_method :authorized_for_filter?
helper_method :author?
helper_method :author_or_admin?
def show
@@ -65,8 +66,12 @@ class UsersController < ApplicationController
@user.public_activity || authorized_current_user?
end
def author?
@author ||= current_user && (current_user == @user)
end
def author_or_admin?
@author_or_admin ||= current_user && (current_user == @user || current_user.administrator?)
@author_or_admin ||= current_user && (author? || current_user.administrator?)
end
def authorized_current_user?