Now we'll really be able to create a new users group
This commit is contained in:
parent
a48ab2e7b6
commit
471e6c23fd
@ -105,12 +105,17 @@ class AccessControlList():
|
||||
|
||||
def addUserInGroup(self, user, group):
|
||||
try:
|
||||
if self.__data['groups'][group].count(user) == 0:
|
||||
self.__data['groups'][group].append(user)
|
||||
self.saveToFile()
|
||||
if list(self.__data['groups'].keys()).count(group) != 0:
|
||||
if self.__data['groups'][group].count(user) != 0:
|
||||
raise CommandException("This user is already in this group !")
|
||||
|
||||
else:
|
||||
self.__data['groups'][group].append(user)
|
||||
|
||||
else:
|
||||
raise CommandException("This user is already in this group !")
|
||||
self.__data['groups'][group] = [user]
|
||||
|
||||
self.saveToFile()
|
||||
|
||||
except:
|
||||
raise CommandException("Can\'t add this user into this group.")
|
||||
|
Reference in New Issue
Block a user