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)


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

property :name, type: String, required: true

#typeString

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

Returns:

  • (String)


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

property :type, type: String, required: true

#urnString

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

Returns:

  • (String)


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

property :urn, type: String

Instance Method Details

#validate_for_create!Object

Raises:

  • (ArgumentError)


27
28
29
30
# File 'lib/g5_authentication_client/role.rb', line 27

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