How to check if the user has a specific pivilage

Added by Jai prakash over 4 years ago

Trying to write a plug-in for which I need to check if the user has a particular permission . For example I am thinking of something like this

if (user.current has "view_private_notes" )
do something
end

How can i do this

Replies (1)

RE: How to check if the user has a specific pivilage - Added by Arnaud Martel over 4 years ago

if User.current.allowed_to?(:view_private_notes, @project)
do something
end

(1-1/1)