lib/adauth/user_model.rb in adauth-1.0.1 vs lib/adauth/user_model.rb in adauth-1.1.0
- old
+ new
@@ -16,10 +16,20 @@
# The array is generated from the group_strings attribute which is set by the adauth update and create methods. This array will match the windows security groups the user is a member of.
def groups
group_strings.split(", ")
end
+ # Returns an array of groups for the user
+ #
+ # Called as:
+ # UserInstance.ous
+ #
+ # The array is generated from the group_strings attribute which is set by the adauth update and create methods. This array will match the orginizational units the user is a member of.
+ def ous
+ ou_strings.split(", ")
+ end
+
# Update the user record using an instance of Adauth::User
#
# Called as:
# UserInstance.update_from_adauth(AdauthUserInstance)
#
@@ -55,9 +65,10 @@
# Takes the Adauth::User input and creates a user record with matching details
def create_user_with_adauth(adauth_user)
create! do |user|
user.login = adauth_user.login
user.group_strings = adauth_user.groups.join(", ")
+ user.ou_strings = adauth_user.ous.join(", ")
user.name = adauth_user.name
end
end
end
end
\ No newline at end of file