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, #object_type_serialization, #serialize, #to_json, #to_yaml
Constructor Details
Returns a new instance of AuthzRealmRole.
269
270
271
272
|
# File 'lib/sakai-info/authz.rb', line 269
def initialize(realm, role)
@realm = realm
@role = role
end
|
Instance Attribute Details
#realm ⇒ Object
Returns the value of attribute realm.
267
268
269
|
# File 'lib/sakai-info/authz.rb', line 267
def realm
@realm
end
|
#role ⇒ Object
Returns the value of attribute role.
267
268
269
|
# File 'lib/sakai-info/authz.rb', line 267
def role
@role
end
|
Class Method Details
.find_by_realm_id(realm_id) ⇒ Object
290
291
292
293
294
295
296
297
298
299
300
301
302
303
|
# File 'lib/sakai-info/authz.rb', line 290
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
305
306
307
308
309
310
311
312
|
# File 'lib/sakai-info/authz.rb', line 305
def default_serialization
{
"realm_name" => self.realm.name,
"role_name" => self.role.name,
"user_count" => self.user_count,
"function_count" => self.function_count
}
end
|
#summary_serialization ⇒ Object
314
315
316
317
318
319
320
|
# File 'lib/sakai-info/authz.rb', line 314
def summary_serialization
{
"role_name" => self.role.name,
"user_count" => self.user_count,
"function_count" => self.function_count
}
end
|