mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #26083 from TheScriptSage/develop
Add '*' case to api_acl.
This commit is contained in:
commit
c7f614eb8b
@ -362,6 +362,8 @@ def salt_api_acl_tool(username, request):
|
||||
- 1.1.1.2
|
||||
foo:
|
||||
- 8.8.4.4
|
||||
bar:
|
||||
- '*'
|
||||
|
||||
:param username: Username to check against the API.
|
||||
:type username: str
|
||||
@ -390,14 +392,14 @@ def salt_api_acl_tool(username, request):
|
||||
users = acl.get('users', {})
|
||||
if users:
|
||||
if username in users:
|
||||
if ip in users[username]:
|
||||
if ip in users[username] or '*' in users[username]:
|
||||
logger.info(success_str.format(username, ip))
|
||||
return True
|
||||
else:
|
||||
logger.info(failure_str.format(username, ip))
|
||||
return False
|
||||
elif username not in users and '*' in users:
|
||||
if ip in users['*']:
|
||||
if ip in users['*'] or '*' in users['*']:
|
||||
logger.info(success_str.format(username, ip))
|
||||
return True
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user