Class ActiveLdap::Schema::ObjectClass
In: lib/active_ldap/schema.rb
Parent: Entry
Error AttributeAssignmentError AdapterNotSpecified OperationNotPermitted RequiredObjectClassMissed ConnectionError RequiredAttributeMissed LdifInvalid LdapError DistinguishedNameNotSetError EntryNotFound SaveError StrongAuthenticationRequired NotImplemented AdapterNotFound TimeoutError AuthenticationError AttributeValueInvalid EntryNotSaved DistinguishedNameInputInvalid EntryAlreadyExist ObjectClassError UnknownAttribute EntryInvalid DeleteError ConfigurationError ConnectionNotSetup DistinguishedNameInvalid Schema\n[lib/active_ldap/schema.rb\nlib/active_ldap/schema/syntaxes.rb] Base DistinguishedName Reloadable::Deprecated Reloadable::Subclasses Enumerable Ldif Collection EntryAttribute StandardError Children HasMany HasManyWrap BelongsToMany Proxy BelongsTo Normalizable Common Find LDIF Delete Update GetText Parser ActiveRecord::Callbacks ActiveRecord::Validations Base\n[lib/active_ldap/adapter/base.rb\nlib/active_ldap/adapter/jndi.rb\nlib/active_ldap/adapter/ldap.rb\nlib/active_ldap/adapter/net_ldap.rb] Jndi Ldap NetLdap GetTextSupport Xml JndiConnection lib/active_ldap/distinguished_name.rb lib/active_ldap/base.rb lib/active_ldap/xml.rb lib/active_ldap/schema.rb lib/active_ldap/entry_attribute.rb lib/active_ldap/ldif.rb lib/active_ldap/ldap_error.rb LdapBenchmarking ActionController ClassMethods Associations Compatible ClassMethods Tree Acts lib/active_ldap/association/has_many_wrap.rb lib/active_ldap/association/children.rb lib/active_ldap/association/collection.rb lib/active_ldap/association/proxy.rb lib/active_ldap/association/belongs_to_many.rb lib/active_ldap/association/belongs_to.rb lib/active_ldap/association/has_many.rb HasManyUtils Association Populate Command ClassMethods Normalizable Attributes Escape GetTextSupport Update Common ModifyNameRecordLoadable AddOperationModifiable DeleteOperationModifiable ReplaceOperationModifiable ModifyRecordLoadable DeleteRecordLoadable AddRecordLoadable ContentRecordLoadable LDIF Delete Find Operations ClassMethods Configuration lib/active_ldap/get_text/parser.rb GetText ClassMethods Callbacks ClassMethods ObjectClass Validations lib/active_ldap/adapter/jndi_connection.rb lib/active_ldap/adapter/net_ldap.rb lib/active_ldap/adapter/ldap.rb lib/active_ldap/adapter/base.rb lib/active_ldap/adapter/jndi.rb Adapter Helper GetTextFallback ClassMethods HumanReadable Salt UserPassword ClassMethods Connection ActiveLdap dot/m_45_0.png

Methods

Constants

UNWRITABLE_MUST_ATTRIBUTES = ["nTSecurityDescriptor"]

Attributes

super_classes  [R] 

Public Class methods

[Source]

     # File lib/active_ldap/schema.rb, line 620
620:       def initialize(name, schema)
621:         super(name, schema, "objectClasses")
622:       end

Public Instance methods

[Source]

     # File lib/active_ldap/schema.rb, line 636
636:       def may(include_super_class=true)
637:         if include_super_class
638:           @all_may
639:         else
640:           @may
641:         end
642:       end

[Source]

     # File lib/active_ldap/schema.rb, line 628
628:       def must(include_super_class=true)
629:         if include_super_class
630:           @all_must
631:         else
632:           @must
633:         end
634:       end

[Source]

     # File lib/active_ldap/schema.rb, line 624
624:       def super_class?(object_class)
625:         @super_classes.include?(object_class)
626:       end

Private Instance methods

[Source]

     # File lib/active_ldap/schema.rb, line 691
691:       def attribute(attribute_name, name=@name)
692:         @schema.object_class_attribute(name, attribute_name) +
693:           @schema.dit_content_rule_attribute(name, attribute_name)
694:       end

[Source]

     # File lib/active_ldap/schema.rb, line 670
670:       def collect_attributes
671:         must = attribute('MUST').reject do |name|
672:           UNWRITABLE_MUST_ATTRIBUTES.include?(name)
673:         end.uniq
674:         must = must.collect {|name| @schema.attribute(name)}
675:         may = attribute('MAY').uniq.collect {|name| @schema.attribute(name)}
676: 
677:         all_must = must.dup
678:         all_may = may.dup
679:         @super_classes.each do |super_class|
680:           all_must.concat(super_class.must(false))
681:           all_may.concat(super_class.may(false))
682:         end
683: 
684:         # Clean out the dupes.
685:         all_must.uniq!
686:         all_may.uniq!
687: 
688:         [must, may, all_must, all_may]
689:       end

[Source]

     # File lib/active_ldap/schema.rb, line 645
645:       def collect_info
646:         @description = attribute("DESC")[0]
647:         @super_classes = collect_super_classes
648:         @must, @may, @all_must, @all_may = collect_attributes
649:       end

[Source]

     # File lib/active_ldap/schema.rb, line 651
651:       def collect_super_classes
652:         super_classes = attribute('SUP')
653:         loop do
654:           start_size = super_classes.size
655:           new_super_classes = []
656:           super_classes.each do |super_class|
657:             new_super_classes.concat(attribute('SUP', super_class))
658:           end
659: 
660:           super_classes.concat(new_super_classes)
661:           super_classes.uniq!
662:           break if super_classes.size == start_size
663:         end
664:         super_classes.collect do |name|
665:           @schema.object_class(name)
666:         end
667:       end

[Validate]