Class: Mooset::Endpoints::Ldap::Ou

Inherits:
Group show all
Defined in:
lib/mooset/endpoints/ldap/ou.rb

Instance Attribute Summary

Attributes inherited from Model

#endpoint

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Models::Group

#to_s

Methods inherited from Model

finders, #finders, #initialize, #to_json, #to_s

Constructor Details

This class inherits a constructor from Mooset::Model

Class Method Details

.build(endpoint, params) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/mooset/endpoints/ldap/ou.rb', line 5

def self.build(endpoint, params)
  group = Optional.new(params)
  new(
    endpoint: endpoint,
    id: group[:dn].first.value,
    dn: group[:dn].first.value,
    name: group[:ou].first.value
  )
end

Instance Method Details

#membersObject



15
16
17
# File 'lib/mooset/endpoints/ldap/ou.rb', line 15

def members
  endpoint.users.query('(&(objectClass=user)(!(useraccountcontrol:1.2.840.113556.1.4.803:=2)))', base: dn)
end