Class: SakaiInfo::AuthzRealmRole
Instance Attribute Summary collapse
Attributes inherited from SakaiObject
#id
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from SakaiObject
all_serializations, #dbrow_only_serialization, #dbrow_serialization, descendants, #object_type_serialization, #serialize, #shell_serialization, #to_csv, #to_json, #to_yaml
Constructor Details
Returns a new instance of AuthzRealmRole.
385
386
387
388
|
# File 'lib/sakai-info/authz.rb', line 385
def initialize(realm, role)
@realm = realm
@role = role
end
|
Instance Attribute Details
#realm ⇒ Object
Returns the value of attribute realm.
383
384
385
|
# File 'lib/sakai-info/authz.rb', line 383
def realm
@realm
end
|
#role ⇒ Object
Returns the value of attribute role.
383
384
385
|
# File 'lib/sakai-info/authz.rb', line 383
def role
@role
end
|
Class Method Details
.find_by_realm_id(realm_id) ⇒ Object
410
411
412
413
414
415
416
417
418
419
420
421
422
423
|
# File 'lib/sakai-info/authz.rb', line 410
def self.find_by_realm_id(realm_id)
realm_roles = []
realm = AuthzRealm.find_by_id(realm_id)
DB.connect.fetch("select distinct role_key from " +
"sakai_realm_rl_fn where " +
"realm_key = ?", realm_id) do |row|
begin
role = AuthzRole.find_by_id(row[:role_key].to_i)
realm_roles << AuthzRealmRole.new(realm, role)
rescue AuthzRoleNotFoundException
end
end
realm_roles
end
|
Instance Method Details
#default_serialization ⇒ Object
425
426
427
428
429
430
431
432
|
# File 'lib/sakai-info/authz.rb', line 425
def default_serialization
{
"realm_name" => self.realm.name,
"role_name" => self.role.name,
"user_count" => self.user_count,
"function_count" => self.function_count,
}
end
|
#realm_summary_serialization ⇒ Object
441
442
443
444
445
446
447
|
# File 'lib/sakai-info/authz.rb', line 441
def realm_summary_serialization
{
"role" => self.role.name,
"user_count" => self.user_count,
"function_count" => self.function_count,
}
end
|
#summary_serialization ⇒ Object
434
435
436
437
438
439
|
# File 'lib/sakai-info/authz.rb', line 434
def summary_serialization
{
"realm" => self.realm.name,
"role" => self.role.name,
}
end
|