Sha256: 864630e43b0bf1641c6f3415a81e9ec4c571407ce3e4be3b5e5a5ea99a51071d

Contents?: true

Size: 437 Bytes

Versions: 5

Compression:

Stored size: 437 Bytes

Contents

module Conjur
  module ActsAsRole
    def roleid
      [ conjur_account, role_kind, id ].join(':')
    end
    
    def role_kind
      self.class.name.split('::')[-1].underscore
    end
    
    def conjur_account
      Conjur::Core::API.conjur_account
    end
    
    def role
      require 'conjur/role'
      Conjur::Role.new(Conjur::Authz::API.host, self.options)[Conjur::API.parse_role_id(self.roleid).join('/')]
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
conjur-api-2.1.7 lib/conjur/acts_as_role.rb
conjur-api-2.1.6 lib/conjur/acts_as_role.rb
conjur-api-2.1.5 lib/conjur/acts_as_role.rb
conjur-api-2.1.4 lib/conjur/acts_as_role.rb
conjur-api-2.1.3 lib/conjur/acts_as_role.rb