mashirozx/mastodon

View on GitHub
app/policies/webhook_policy.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

class WebhookPolicy < ApplicationPolicy
  def index?
    role.can?(:manage_webhooks)
  end

  def create?
    role.can?(:manage_webhooks)
  end

  def show?
    role.can?(:manage_webhooks)
  end

  def update?
    role.can?(:manage_webhooks)
  end

  def enable?
    role.can?(:manage_webhooks)
  end

  def disable?
    role.can?(:manage_webhooks)
  end

  def rotate_secret?
    role.can?(:manage_webhooks)
  end

  def destroy?
    role.can?(:manage_webhooks)
  end
end