Sha256: a626647c450a49a51eefca9d532d84494ebfbfdc92ed619d0be3b6a934cee945
Contents?: true
Size: 389 Bytes
Versions: 6
Compression:
Stored size: 389 Bytes
Contents
class PurchaseRequestPolicy < ApplicationPolicy def index? true if user.try(:has_role?, 'User') end def show? if user.try(:has_role?, 'Librarian') true elsif user.try(:has_role?, 'User') true if record.user == user end end def create? true if user.try(:has_role?, 'User') end def update? show? end def destroy? show? end end
Version data entries
6 entries across 6 versions & 1 rubygems