MCPcopy Create free account
hub / github.com/saltstack/salt / __get_acl

Method __get_acl

salt/auth/__init__.py:163–184  ·  view source on GitHub ↗

Returns ACL for a specific user. Returns None if eauth doesn't provide any for the user. I. e. None means: use acl declared in master config.

(self, load)

Source from the content-addressed store, hash-verified

161 return False
162
163 def __get_acl(self, load):
164 """
165 Returns ACL for a specific user.
166 Returns None if eauth doesn't provide any for the user. I. e. None means: use acl declared
167 in master config.
168 """
169 if "eauth" not in load:
170 return None
171 mod = self.opts["eauth_acl_module"]
172 if not mod:
173 mod = load["eauth"]
174 fstr = f"{mod}.acl"
175 if fstr not in self.auth:
176 return None
177 fcall = salt.utils.args.format_call(
178 self.auth[fstr], load, expected_extra_kws=AUTH_INTERNAL_KEYWORDS
179 )
180 try:
181 return self.auth[fstr](*fcall["args"], **fcall["kwargs"])
182 except Exception as e: # pylint: disable=broad-except
183 log.debug("Authentication module threw %s", e)
184 return None
185
186 def __process_acl(self, load, auth_list):
187 """

Callers 2

mk_tokenMethod · 0.95
get_auth_listMethod · 0.95

Calls 1

debugMethod · 0.80

Tested by

no test coverage detected