Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
namara / lib / authorization.rb
Size: Mime:
require_relative 'rpc/authorization/authorization_twirp'
require_relative 'helpers/object_to_hash'

class Namara
  def can(authorizations = [])
    response = rpc_request(authorization_client) do |client|
      client.can({ authorizations: authorizations }, rpc_headers)
    end

    ObjectToHash.to_hash_array(response.data.authorizations.to_a)
  end

  private

  def authorization_client
    @authorization_client ||= Authorization::AuthorizationServiceClient.new(api_url)
  end
end