locomotivecms/engine

View on GitHub
app/policies/locomotive/content_entry_policy.rb

Summary

Maintainability
A
30 mins
Test Coverage
module Locomotive
  class ContentEntryPolicy < ApplicationPolicy

    def index?
      site_staff?
    end

    def new?
      site_staff?
    end

    def edit?
      site_staff?
    end

    def create?
      site_staff? && !membership.visitor?
    end

    def update?
      site_staff? && !membership.visitor?
    end

    def destroy?
      site_staff? && !membership.visitor?
    end    
  end
end