Method: ApplicationHelper#check_your_privilege

Defined in:
app/helpers/application_helper.rb

#check_your_privilege(privilege) ⇒ Boolean

Check if the current user has a specified privilege.

Parameters:

  • privilege (String)

    The internal_id of the privilege to query.

Returns:

  • (Boolean)


32
33
34
# File 'app/helpers/application_helper.rb', line 32

def check_your_privilege(privilege)
  !current_user.nil? && current_user&.privilege?(privilege)
end