cschiewek/devise_ldap_authenticatable — Issue #74: undefined method 'get_ldap_entry' for Devise::LdapAdapter:Module (v0.5.0)
Author: kwirschau
Created: 2012-03-02 06:54:49+00:00
State: open

I am running devise_ldap_authenticatable 0.5.0 here and get the error message `undefined method 'get_ldap_entry' for Devise::LdapAdapter:Module` when trying to use `admin?` in this code stub:

class User < ActiveRecord::Base
devise :ldap_authenticatable, :rememberable, :trackable
attr_accessible :email, :password, :password_confirmation, :remember_me, :cn
def prename
Devise::LdapAdapter.get_ldap_param(self.cn,"givenName")
end
def admin?
groups = Devise::LdapAdapter.get_ldap_entry(self.cn)["memberOf"]
groups.include?("CN=some,OU=where,OU=at,DC=my,DC=ac,DC=tivedir,DC=ectory")
end

Background: I am using `admin?` to identify admin users for cancan's ability.rb and basically trying to work around [issue 36](https://github.com/cschiewek/devise_ldap_authenticatable/issues/36)