Class: QuickBase::Objects::Role

Inherits:
Object
  • Object
show all
Defined in:
lib/QuickBaseObjects.rb

Overview

A Role associated with an Application.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#accessObject (readonly)

Returns the value of attribute access.



347
348
349
# File 'lib/QuickBaseObjects.rb', line 347

def access
  @access
end

#access_idObject (readonly)

Returns the value of attribute access_id.



347
348
349
# File 'lib/QuickBaseObjects.rb', line 347

def access_id
  @access_id
end

#idObject (readonly)

Returns the value of attribute id.



347
348
349
# File 'lib/QuickBaseObjects.rb', line 347

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



347
348
349
# File 'lib/QuickBaseObjects.rb', line 347

def name
  @name
end

Instance Method Details

#addUser(user) ⇒ Object



357
358
359
360
# File 'lib/QuickBaseObjects.rb', line 357

def addUser(user)
  raise "#{user} is not a User object" if !is_a?(User)
  @qbc.addUserToRole(@dbid,user.id,id)
end

#build(role_xml, qbc) ⇒ Object



348
349
350
351
352
353
354
355
356
# File 'lib/QuickBaseObjects.rb', line 348

def build(role_xml,qbc)
  raise "role_xml is not an XML element" if !role_xml.is_a?(REXML::Element)
  @qbc = qbc
  @dbid = qbc.dbid.dup
  @id = role_xml.attributes["id"]
  @name = role_xml.elements["name"].text.dup
  @access = role_xml.elements["access"].text.dup
  @access_id = role_xml.elements["access"].attributes["id"]
end

#removeUser(user) ⇒ Object



361
362
363
364
# File 'lib/QuickBaseObjects.rb', line 361

def removeUser(user)
  raise "#{user} is not a User object" if !is_a?(User)
  @qbc.removeUserFromRole(@dbid,user.id,role.id)
end