class DirectoryPolicy < ApplicationPolicy class Scope < Scope def resolve case user.role when "account_manager" scope when "project_manager" scope.for_project_managers when "associate" scope.for_associates else scope.none end end end def create? true end def edit? true end def show? true end def update? true end def destroy? true end def new_file? true end def download_file? true end def destroy_file? true end def can_view_permissions_settings? user.manager? || user.account_manager? end end