Sha256: 0b96528369954770726b12a4a9e9ebef576750a02e873f6b94588da1f89cd3cc
Contents?: true
Size: 428 Bytes
Versions: 39
Compression:
Stored size: 428 Bytes
Contents
class AgentTypePolicy < ApplicationPolicy def index? true if user.try(:has_role?, 'Librarian') end def show? true if user.try(:has_role?, 'Librarian') end def create? true if user.try(:has_role?, 'Administrator') end def update? true if user.try(:has_role?, 'Administrator') end def destroy? if user.try(:has_role?, 'Administrator') true if record.agents.empty? end end end
Version data entries
39 entries across 38 versions & 2 rubygems