Sha256: 7c3ae61f43c8d4f30d4addcb81c445fe9be892da89b79ce15709902e58a92423
Contents?: true
Size: 648 Bytes
Versions: 14
Compression:
Stored size: 648 Bytes
Contents
class CheckoutPolicy < ApplicationPolicy def index? true end def show? if user.try(:has_role?, 'Librarian') true elsif user && (user == record.user) true end end def create? user.try(:has_role?, 'Librarian') end def update? if user.try(:has_role?, 'Librarian') true elsif user && (user == record.user) true end end def destroy? if record.checkin && record.user if user.try(:has_role?, 'Librarian') true elsif user && (user == record.user) true end end end def remove_all? true if user.try(:has_role?, 'User') end end
Version data entries
14 entries across 14 versions & 1 rubygems