diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-09-04 11:37:39 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-09-07 09:43:13 +0200 |
commit | 85bca06fe0ee2923421f013da3e9f53abbfff673 (patch) | |
tree | 9760887748d9250f90e5ad068413f0d4f913e015 /src/afb-auth.c | |
parent | 91c12808e08fb30e58a3d2e008569933f409d6db (diff) |
Implement afb_req_has_permission
This new verb is available in bindings to check
whether the client identified by a request has
a given permission or not.
Change-Id: I5eaa0892d8260d26bd76f37123251c103c981e10
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-auth.c')
-rw-r--r-- | src/afb-auth.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/afb-auth.c b/src/afb-auth.c index ff4ff9da..9d54a03b 100644 --- a/src/afb-auth.c +++ b/src/afb-auth.c @@ -43,7 +43,7 @@ int afb_auth_check(struct afb_xreq *xreq, const struct afb_auth *auth) return afb_context_check_loa(&xreq->context, auth->loa); case afb_auth_Permission: - return afb_auth_check_permission(xreq, auth->text); + return afb_auth_has_permission(xreq, auth->text); case afb_auth_Or: return afb_auth_check(xreq, auth->first) || afb_auth_check(xreq, auth->next); @@ -68,7 +68,7 @@ int afb_auth_check(struct afb_xreq *xreq, const struct afb_auth *auth) static cynara *handle; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -int afb_auth_check_permission(struct afb_xreq *xreq, const char *permission) +int afb_auth_has_permission(struct afb_xreq *xreq, const char *permission) { int rc; @@ -103,7 +103,7 @@ int afb_auth_check_permission(struct afb_xreq *xreq, const char *permission) /*********************************************************************************/ #else -int afb_auth_check_permission(struct afb_xreq *xreq, const char *permission) +int afb_auth_has_permission(struct afb_xreq *xreq, const char *permission) { WARNING("Granting permission %s by default of backend", permission ?: "(null)"); return !!permission; |