Method: ApplicationHelper#check_your_post_privilege

Defined in:
app/helpers/application_helper.rb

#check_your_post_privilege(post, privilege) ⇒ Boolean

Checks if the current user has a specified privilege on a post.

Parameters:

  • post (Post)

    A post to use as context for the privilege.

  • privilege (String)

    The internal_id of the privilege to query.

Returns:

  • (Boolean)


24
25
26
# File 'app/helpers/application_helper.rb', line 24

def check_your_post_privilege(post, privilege)
  !current_user.nil? && current_user&.has_post_privilege?(privilege, post)
end