Sha256: d03d54b82ebdafb865c4ce498a01cfb9eccf00d53c92e784a69ce5dcf50daa69
Contents?: true
Size: 720 Bytes
Versions: 38
Compression:
Stored size: 720 Bytes
Contents
require 'objects/group' class User < ActiveLdap::Base ldap_mapping :dn_attribute => 'uid', :prefix => 'ou=People', :classes => ['person', 'posixAccount'] belongs_to :primary_group, :class_name => "Group", :foreign_key => "gidNumber", :primary_key => "gidNumber" belongs_to :groups, :many => 'memberUid' # An example of using the old "return_objects" API with the # new ActiveRecord-style API. alias groups_mapping groups def groups(return_objects=true) return groups_mapping if return_objects attr = 'cn' Group.search(:attribute => 'memberUid', :value => id, :attributes => [attr]).map {|dn, attrs| attrs[attr]}.flatten end end
Version data entries
38 entries across 38 versions & 3 rubygems