memset(&context->subject, 0, sizeof(context->subject));
memset(&context->resource, 0, sizeof(context->resource));
context->permission = 0x0;
- context->matchingAclFound = false;
context->amsProcessing = false;
context->retVal = ACCESS_DENIED_POLICY_ENGINE_ERROR;
if (IsResourceInAce(context->resource, currentAce))
{
OIC_LOG_V(INFO, TAG, "%s:found matching resource in ACE" ,__func__);
- context->matchingAclFound = true;
// Found the resource, so it's down to valid period & permission.
context->retVal = ACCESS_DENIED_INVALID_PERIOD;
{
OIC_LOG_V(INFO, TAG, "%s:no ACL found matching subject for resource %s",__func__, context->resource);
}
- } while ((NULL != currentAce) && (false == context->matchingAclFound));
+ } while ((NULL != currentAce) && (ACCESS_GRANTED != context->retVal));
if (IsAccessGranted(context->retVal))
{
ProcessAccessRequest(context);
- // If matching ACL not found, and subject != wildcard, try wildcard.
- if ((false == context->matchingAclFound) && \
+ // If access not already granted, and requested subject != wildcard,
+ // try looking for a wildcard ACE that grants access.
+ if ((ACCESS_GRANTED != context->retVal) && \
(false == IsWildCardSubject(&context->subject)))
{
//Saving subject for Amacl check