diff options
author | 2017-05-29 16:11:49 +0200 | |
---|---|---|
committer | 2017-05-29 16:11:49 +0200 | |
commit | 3dbe2d3eeeec9c1d3cf82f41378b306499b9d41b (patch) | |
tree | 910c8760fd36ce0844545c50d6bb4408d01cfb85 /src/afb-auth.c | |
parent | db01090e1f869965c07b12d9480fa6f3d2e7b1b0 (diff) |
Relax authorisation checlk for self
Change-Id: I115bbebb2f51be92578d1cc6b2fb5ae89813b630
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-auth.c')
-rw-r--r-- | src/afb-auth.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/afb-auth.c b/src/afb-auth.c index 82e6fd21..900ec4c6 100644 --- a/src/afb-auth.c +++ b/src/afb-auth.c @@ -45,7 +45,10 @@ int afb_auth_check(const struct afb_auth *auth, struct afb_xreq *xreq) return afb_context_check_loa(&xreq->context, auth->loa); case afb_auth_Permission: - return xreq->cred && auth->text && check_permission(auth->text, xreq); + if (xreq->cred && auth->text) + return check_permission(auth->text, xreq); + /* TODO: handle case of self permission */ + return 1; case afb_auth_Or: return afb_auth_check(auth->first, xreq) || afb_auth_check(auth->next, xreq); |