Class: G5AuthenticationClient::Role

Inherits:
Modelish::Base
  • Object
show all
Defined in:
lib/g5_authentication_client/role.rb

Overview

G5 Authentication user role info

Constant Summary collapse

GLOBAL =
'GLOBAL'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameString

The name associated with this user role

Returns:

  • (String)


13
# File 'lib/g5_authentication_client/role.rb', line 13

property :name, type: String, required: true

#typeString

The role’s type. If ‘GLOBAL’ then not role not associated with a resource

Returns:

  • (String)


18
# File 'lib/g5_authentication_client/role.rb', line 18

property :type, type: String, required: true

#urnString

The role’s resource urn. Will be nil if type=‘GLOBAL’

Returns:

  • (String)


23
# File 'lib/g5_authentication_client/role.rb', line 23

property :urn, type: String

Instance Method Details

#validate_for_create!Object

Raises:

  • (ArgumentError)


25
26
27
28
# File 'lib/g5_authentication_client/role.rb', line 25

def validate_for_create!
  validate!
  raise ArgumentError.new("URN required when type != '#{GLOBAL}'") if urn.nil? && type != GLOBAL
end