Project

General

Profile

How to check if the user has a specific pivilage

Added by Jai prakash almost 11 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 almost 11 years ago

if User.current.allowed_to?(:view_private_notes, Herve Harster)
do something
end

    (1-1/1)