Sha256: 86408fb1e4f8505935b97f822792d6b3ac937e9114de81d864467125fd363ed5
Contents?: true
Size: 408 Bytes
Versions: 8
Compression:
Stored size: 408 Bytes
Contents
module Pageflow class EntryTemplatePolicy < ApplicationPolicy def initialize(user, entry_template) @user = user @entry_template = entry_template end def create? update? end def update? allows?(%w(publisher manager)) end private def allows?(roles) @user.memberships.where(role: roles, entity: @entry_template.account).any? end end end
Version data entries
8 entries across 8 versions & 1 rubygems