Sha256: 2311d1397ecf81c9b37023c79ee267b0ef43bec7cc5e296461035ceea6f5ff1d
Contents?: true
Size: 563 Bytes
Versions: 87
Compression:
Stored size: 563 Bytes
Contents
module Pageflow module Admin class EntryTabPolicy attr_reader :user, :tab, :query def initialize(user, tab) @user = user @tab = tab @query = EntryRoleQuery.new(user, tab.resource) end def see? if user.admin? true elsif tab.required_account_role query.has_at_least_account_role?(tab.required_account_role) elsif tab.required_role query.has_at_least_role?(tab.required_role) else !tab.admin_only? end end end end end
Version data entries
87 entries across 87 versions & 1 rubygems