Sha256: 410a21e4a1059172b2b9e8a8791634b753e3747226666c302776c8cbdba27814

Contents?: true

Size: 568 Bytes

Versions: 5

Compression:

Stored size: 568 Bytes

Contents

module CanTango
  module Permits
    class UserPermit < CanTango::Permit
      class Builder < CanTango::PermitEngine::Builder::Base
        # class NoAvailableRoles < StandardError; end

        # builds a list of Permits for each role of the current ability user (or account)
        # @return [Array<RoleGroupPermit::Base>] the role permits built for this ability
        def build
          # raise NoAvailableRoles, "no available roles are defined" if available_roles.empty?
          [] << create_permit(user.class.to_s)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cantango-0.8.7 lib/cantango/permits/user_permit/builder.rb
cantango-0.8.6.2 lib/cantango/permits/user_permit/builder.rb
cantango-0.8.6.1 lib/cantango/permits/user_permit/builder.rb
cantango-0.8.6 lib/cantango/permits/user_permit/builder.rb
cantango-0.8.5.1 lib/cantango/permits/user_permit/builder.rb