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);
if (hreq) {
/* init the request */
afb_xreq_init(&hreq->xreq, &afb_hreq_xreq_query_itf);
- hreq->xreq.cred = afb_cred_current();
hreq->reqid = ++global_reqids;
}
return hreq;
afb_xreq_init(&svcreq->xreq, &afb_svc_xreq_itf);
afb_context_init(&svcreq->xreq.context, svc->session, NULL);
svcreq->xreq.context.validated = 1;
- svcreq->xreq.cred = afb_cred_current();
copy = (char*)&svcreq[1];
memcpy(copy, api, lenapi);
svcreq->xreq.api = copy;
goto error4;
result->cred = afb_cred_create_for_socket(fd);
- if (!result->cred)
- result->cred = afb_cred_current();
result->apiset = afb_apiset_addref(apiset);
return result;