Project

General

Profile

Download (573 Bytes) Statistics
| Branch: | Tag: | Revision:
module SharedAttr
module_function

def check_common_attributes(item)
if item.attribute_present?('allowedServices')
user_services = ActiveLdap::Base.find(:all, :scope => :sub, :filter => "(objectClass=userService)", :attributes => ['cn'])
srv_names = user_services.collect {|srv| srv.cn }

invalid_srv_names = item.allowedServices(true) - (item.allowedServices(true) & srv_names)
unless invalid_srv_names.empty?
raise PreProcessingError, "Invalid User Service(s) name(s): " + invalid_srv_names.join(", ")
end
end
end
end
    (1-1/1)