Project

General

Profile

« Previous | Next » 

Revision 6938ac96

Added by Marc Dequènes about 14 years ago

  • ID 6938ac96781698408302bacc813ea26b2ac22229

[evol] implemented expert_attributes and hidden_attributes for aspects (closes #147)

View differences:

data/ldap_shadows/default_config/aspect.yaml
associated_relations: []
associated_attributes: []
associate_unclaimed_attributes: false
presentation:
hidden_attributes: []
expert_attributes: []
relations: {}
plugin: {}
data/ldap_shadows/schema/aspect.yaml
sequence:
- type: str
"associate_unclaimed_attributes": {type: bool}
"presentation":
type: map
mapping:
"hidden_attributes":
type: seq
sequence:
- type: str
"expert_attributes":
type: seq
sequence:
- type: str
"relations":
type: map
mapping:
lib/ldap_shadows/elements/object.rb
end
def organized_data
# merge ignored and expert attributes for object and all present aspects
ignored_attrs = self.class.shadow.get_config[:presentation][:hidden_attributes]
ignored_attrs += self.class.parameters[:presentation][:hidden_attributes]
expert_attributes = self.class.parameters[:presentation][:expert_attributes]
self.aspects.values.each do |aspect|
aspect_data = aspect.parameters
ignored_attrs += aspect_data[:presentation][:hidden_attributes]
expert_attributes += aspect_data[:presentation][:expert_attributes]
end
attr_list = self.nonempty_attributes - ignored_attrs
expert_attributes = self.class.parameters[:presentation][:expert_attributes]
admin_attributes = attr_list.select do |attr|
ActiveLdap::Base.schema.attribute(attr).directory_operation?
end

Also available in: Unified diff