10from .mediator_user_classes
import UserList
11from .mediator_group_classes
import GroupList
106 message =
"User '{0}' does not exist. Cannot add to group '{1}'!".format(userName, groupName)
107 raise ValueError(message)
111 message =
"Cannot add user '{0}' to group '{1}' as that group does not exist!".format(userName, groupName)
112 raise ValueError(message)
114 foundGroup.AddUser(userName)
131 message =
"User '{0}' does not exist. Cannot remove from group '{1}'!".format(userName, groupName)
132 raise ValueError(message)
136 message =
"Cannot remove user '{0}' from group '{1}' as that group does not exist!".format(userName, groupName)
137 raise ValueError(message)
139 foundGroup.RemoveUser(userName);
154 message =
"User '{0}' does not exist. Cannot remove from all groups'!".format(userName)
155 raise ValueError(message)
160 if group.ContainsUser(userName):
161 group.RemoveUser(userName)
179 message =
"User '{0}' does not exist. Cannot determine if user is in group '{1}'!".format(userName, groupName)
180 raise ValueError(message)
184 message =
"Cannot determine if user '{0}' is in group '{1}' as that group does not exist!".format(userName, groupName)
185 raise ValueError(message)
187 userInGroup = foundGroup.ContainsUser(userName)
204 message =
"User '{0}' does not exist. Cannot get groups container user!".format(userName)
205 raise ValueError(message)
211 if group.ContainsUser(userName):
212 groupNames.append(groupName)
230 message =
"Cannot determine get users in group '{0}' as that group does not exist!".format(groupName)
231 raise ValueError(message)
233 return foundGroup.Users