More work on the site permissions.

This commit is contained in:
Scott Idem
2024-10-03 16:29:45 -04:00
parent 0f49afec12
commit 7b84e1c1fc
2 changed files with 40 additions and 10 deletions

View File

@@ -118,12 +118,31 @@ if ($ae_loc.site_cfg_json.slct__sponsorship_cfg_id) {
if ($ae_loc.allow_access && !$ae_loc.key_checked) {
console.log(`PASS: The access key was checked earlier.`);
// allow_access should equal true or the access key.
if ($ae_loc.site_access_key || $ae_loc.site_domain_access_key) {
console.log(`We need to do a current check against the allow_access value.`);
if ($ae_loc.site_access_key == $ae_loc.allow_access || $ae_loc.site_domain_access_key == $ae_loc.allow_access) {
console.log(`PASS: The access key was checked earlier and we just now checked the key.`);
} else {
console.log(`FAIL: The access key was checked earlier, but just now failed.`);
if ($ae_loc.trusted_access) {
console.log(`FAIL: The access key was checked earlier and failed, but we have trusted access.`);
$ae_loc.allow_access = true;
} else {
$ae_loc.allow_access = false;
}
}
} else {
// This means this site and domain do not require an access key.
// Do nothing to change the allow_access here at this time.
}
} else if ($ae_loc.allow_access && $ae_loc.key_checked) {
console.log(`PASS: The access key was checked earlier and we just now checked the key.`);
} else if (!$ae_loc.allow_access && $ae_loc.key_checked) {
console.log(`FAIL: The access key was checked earlier and failed.`);
if ($ae_loc.administrator_access) {
console.log(`FAIL: The access key was checked earlier and failed, but we have administrator access.`);
if ($ae_loc.trusted_access) {
console.log(`FAIL: The access key was checked earlier and failed, but we have trusted access.`);
$ae_loc.allow_access = true;
}
} else {