Merge branch 'improvements/defaultConfiguration' into dev

This commit is contained in:
HorlogeSkynet 2017-03-26 11:26:26 +02:00
commit 024ccbd30f
3 changed files with 31 additions and 1 deletions

@ -187,7 +187,7 @@ class AccessControlList():
raise CommandException("This file does not exist...")
def isAdministrator(self, user):
if "administrator" in getGroupsByUser(self.__data['groups'], user):
if user in self.__data['groups']['administrator']:
return True
else:
return False
@ -197,6 +197,7 @@ class AccessControlList():
# Miscellaneous #
#################
# A simple function in order to gather the groups where an user is present
def getGroupsByUser(groups, user):
userGroups = []

25
Server/Data/passwd.json Normal file

@ -0,0 +1,25 @@
{
"groups": {
"administrator": [
"admin"
]
},
"files": {
"Server/Data/shadow.json": {
"execute": [],
"write": [],
"read": [],
"owner": null
},
"Server/Data/passwd.json": {
"execute": [],
"write": [
"administrator"
],
"read": [
"administrator"
],
"owner": null
}
}
}

4
Server/Data/shadow.json Normal file

@ -0,0 +1,4 @@
{
"user": "$pbkdf2-sha512$25000$vxfiPKcUgpAyxliL0RqDsA$c8h7F6JAuThkQwpB2jNwBIsWXe7PsvkSUv0FeDd983flId6AXQIo2PpqcpKum8RenhHF1fMS/afqPo/Pcl7FnQ",
"admin": "$pbkdf2-sha512$25000$rrU2BsAYA8D4v7c2Roix1g$rJA8VV5Y/vNrerB9HfFacXx9ci7cRV0oC3LiB6pCUnRxsgyxpDhnk/uVrHq.qKYxVYoFsBOPV9vrcr6HMlKjyQ"
}