app/lib/ability.rb
# This method is the only role-specific method called for administrators because `can :manage, :all`
# grants all abilities.  If an administrator has another role, calling its role-specific method could
# only reduce the number of abilities (if that method had a `cannot`)
This method is the only role-specific method called for administrators because `can :manage, :all`
grants all abilities.  If an administrator has another role, calling its role-specific method could
only reduce the number of abilities (if that method had a `cannot`)
This method is the only role - specific method called for administrators because ` can : manage : all ` grants all abilities . If an administrator has another role calling its role - specific method could only reduce the number of abilities ( if that method had a ` cannot ` )
def administrator_abilities(user, resource)
    if resource.is_a?(PriceGroup)
      can :manage, UserPriceGroupMember if resource.admin_editable?
      can :manage, AccountPriceGroupMember
    else
      can :manage, :all
      unless user.global_billing_administrator?
        cannot [:manage_accounts, :manage_billing], Facility.cross_facility
      end
      unless user.account_manager?
        cannot :manage, User unless resource.is_a?(Facility)
        if SettingsHelper.feature_off?(:create_users)
          cannot([:edit, :update], User)
        end
      end
    end
    cannot(:switch_to, User) { |target_user| !target_user.active? }
  end
def administrator_abilities ( user , resource ) if resource . is_a? ( PriceGroup ) can :manage , UserPriceGroupMember if resource . admin_editable? can :manage , AccountPriceGroupMember else can :manage , :all unless user . global_billing_administrator? cannot [ :manage_accounts , :manage_billing ] , Facility . cross_facility end unless user . account_manager? cannot :manage , User unless resource . is_a? ( Facility ) if SettingsHelper . feature_off? ( :create_users ) cannot ( [ :edit , :update ] , User ) end end end cannot ( :switch_to , User ) { | target_user | ! target_user . active? } end
This method is the only role-specific method called for administrators because `can :manage, :all`
grants all abilities.
This method is the only role - specific method called for administrators because ` can : manage : all ` grants all abilities .
user
<not_specific>
resource
<not_specific>