Sha256: 1658a348ea9723871336feb864194d91f3969a4c595622da9624a801e390c092
Contents?: true
Size: 427 Bytes
Versions: 40
Compression:
Stored size: 427 Bytes
Contents
class BookstorePolicy < 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.items.empty? end end end
Version data entries
40 entries across 38 versions & 2 rubygems