Merge branch 'improvements/defaultConfiguration' into dev
This commit is contained in:
commit
024ccbd30f
Server
@ -187,7 +187,7 @@ class AccessControlList():
|
|||||||
raise CommandException("This file does not exist...")
|
raise CommandException("This file does not exist...")
|
||||||
|
|
||||||
def isAdministrator(self, user):
|
def isAdministrator(self, user):
|
||||||
if "administrator" in getGroupsByUser(self.__data['groups'], user):
|
if user in self.__data['groups']['administrator']:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
@ -197,6 +197,7 @@ class AccessControlList():
|
|||||||
# Miscellaneous #
|
# Miscellaneous #
|
||||||
#################
|
#################
|
||||||
|
|
||||||
|
# A simple function in order to gather the groups where an user is present
|
||||||
def getGroupsByUser(groups, user):
|
def getGroupsByUser(groups, user):
|
||||||
userGroups = []
|
userGroups = []
|
||||||
|
|
||||||
|
25
Server/Data/passwd.json
Normal file
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
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"
|
||||||
|
}
|
Reference in New Issue
Block a user