Sha256: eaf3a22ad2ca40a931de9aafc281e05dc78f68ed5fd8f9da3713ac9bf5f31c1c
Contents?: true
Size: 563 Bytes
Versions: 14
Compression:
Stored size: 563 Bytes
Contents
require_dependency 'egov_utils/auth_source' module EgovUtils class Group < Principal validates :name, presence: true, uniqueness: true validates :ldap_uid, uniqueness: true, allow_nil: true def members end def ldap_members Rails.cache.fetch("#{cache_key}/ldap_members", expires_in: 2.hours) do if provider.present? auth_source.group_members(ldap_uid) else [] end end end def ldap_member?(user) ldap_members.detect{|mem| mem[:login] == user.login } end end end
Version data entries
14 entries across 14 versions & 1 rubygems