Sha256: 5e769c56b07bcce673675a5f84f28d5306c4289c904dbc53a7d03f7abc62696e
Contents?: true
Size: 448 Bytes
Versions: 17
Compression:
Stored size: 448 Bytes
Contents
class LibraryGroupPolicy < 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.shelves.empty? && !record.web? end end end
Version data entries
17 entries across 15 versions & 2 rubygems