root/conf/ldap_shadows/worlds/MilkyPond/shadows/Administration/plugins/includes/shared_attributes.rb @ f0a9fa9e
2cb97830 | Marc Dequènes (Duck) | 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
|