whimsy-asf 0.0.55 → 0.0.56

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/asf.version +1 -1
  3. data/lib/whimsy/asf/ldap.rb +17 -0
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 014e1d3d29d74cc2577d222313ee2816be728737
4
- data.tar.gz: 734e7cec99fa6d62b49945db165632be24cedc7b
3
+ metadata.gz: 961e38d7670aa8de1653fc6426211ee309711744
4
+ data.tar.gz: a8ee1c7363c5354af325aa2976931479314ac4d3
5
5
  SHA512:
6
- metadata.gz: 514a68fc7099e9f957a0cc0a8cdb0a830e4ef138b34075890c83440387119bae18763a3e57627566fe68a5eb2d5012a7d66551daecc2bb957b6d310de0731c1f
7
- data.tar.gz: f06a33ca3ebee28e99af2283fb2f49aadbc99bd24f00600739c0d11fee45e5d79b4afc6e6fb96dfc27462a9126c810adc294834c3f0ca49dbc2d379da06bb874
6
+ metadata.gz: ab5f7223a0e79078549f894851a21c83b7687bf5d6b008783b87b68ec2e61769284f0949e823bcfafa72b5e5fcf4eb814b9e09159350f6410f6e56ae9845eb7f
7
+ data.tar.gz: 541009a8ea27f5f469c900f6d246abdf17eaab3e762714d9dcb9aa330de8d4caff9d96380d2f69a209a3693da18ecb951d5b235e14326383940472b7ea4f144b
data/asf.version CHANGED
@@ -1 +1 @@
1
- 0.0.55
1
+ 0.0.56
@@ -287,10 +287,26 @@ module ASF
287
287
  ASF.search_one(base, filter, 'cn').flatten
288
288
  end
289
289
 
290
+ def dn
291
+ "cn=#{id},#{self.class.base}"
292
+ end
293
+
290
294
  def members
291
295
  ASF.search_one(base, "cn=#{name}", 'member').flatten.
292
296
  map {|uid| Person.find uid[/uid=(.*?),/,1]}
293
297
  end
298
+
299
+ def remove(people)
300
+ people = Array(people).map(&:dn)
301
+ mod = ::LDAP::Mod.new(::LDAP::LDAP_MOD_DELETE, 'member', people)
302
+ ASF.ldap.modify(self.dn, [mod])
303
+ end
304
+
305
+ def add(people)
306
+ people = Array(people).map(&:dn)
307
+ mod = ::LDAP::Mod.new(::LDAP::LDAP_MOD_ADD, 'member', people)
308
+ ASF.ldap.modify(self.dn, [mod])
309
+ end
294
310
  end
295
311
 
296
312
  module LDAP
@@ -301,6 +317,7 @@ module ASF
301
317
  else
302
318
  ASF.ldap.bind(dn, password)
303
319
  end
320
+ ASF.init_ldap
304
321
  end
305
322
 
306
323
  # select LDAP host
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whimsy-asf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.55
4
+ version: 0.0.56
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-17 00:00:00.000000000 Z
11
+ date: 2015-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri