More fixes related to permissions and Novi for IDAA

This commit is contained in:
Scott Idem
2025-04-25 16:36:21 -04:00
parent f1dc6bd3dc
commit 9bfb6580f2

View File

@@ -47,6 +47,11 @@ if (browser) {
// NOTE: This is checking if they are in an iframe *and* have a Novi UUID. We ignore the iframe mode for trusted and above (administrators, managers, etc).
if ($ae_loc.iframe && $idaa_loc?.novi_uuid?.length == 36 && $idaa_loc?.novi_email?.length > 3 && $idaa_loc?.novi_full_name?.length > 0) {
$ae_loc.access_type = 'authenticated';
$ae_loc.super_access = false;
$ae_loc.manager_access = false;
$ae_loc.administrator_access = false;
$ae_loc.trusted_access = false;
$ae_loc.public_access = false;
$ae_loc.authenticated_access = true;
$ae_loc.anonymous_access = true;
@@ -55,6 +60,11 @@ if (browser) {
$idaa_loc.bb.qry__enabled == 'enabled';
} else if ($ae_loc.iframe) {
$ae_loc.access_type = 'anonymous';
$ae_loc.super_access = false;
$ae_loc.manager_access = false;
$ae_loc.administrator_access = false;
$ae_loc.trusted_access = false;
$ae_loc.public_access = false;
$ae_loc.authenticated_access = false;
$ae_loc.anonymous_access = true;
@@ -63,31 +73,54 @@ if (browser) {
$idaa_loc.bb.qry__enabled == 'enabled';
}
// NOTE: Check if the novi_uuid is in the novi_admin_li list
if ($idaa_loc.novi_uuid && $idaa_loc.novi_admin_li) {
if ($idaa_loc.novi_admin_li.includes($idaa_loc.novi_uuid)) {
$ae_loc.access_type = 'administrator';
$ae_loc.super_access = false;
$ae_loc.manager_access = false;
$ae_loc.administrator_access = true;
$ae_loc.trusted_access = true;
$ae_loc.public_access = true;
$ae_loc.authenticated_access = true;
$ae_loc.anonymous_access = true;
if ($idaa_loc.novi_uuid) {
let flag = false;
// NOTE: Check if the novi_uuid is in the novi_admin_li list
if ( $idaa_loc.novi_admin_li) {
if ($idaa_loc.novi_admin_li.includes($idaa_loc.novi_uuid)) {
$ae_loc.access_type = 'administrator';
$ae_loc.super_access = false;
$ae_loc.manager_access = false;
$ae_loc.administrator_access = true;
$ae_loc.trusted_access = true;
$ae_loc.public_access = true;
$ae_loc.authenticated_access = true;
$ae_loc.anonymous_access = true;
flag = true;
}
}
}
// NOTE: Check if the novi_uuid is in the novi_trusted_li list
if ($idaa_loc.novi_uuid && $idaa_loc.novi_trusted_li) {
if ($idaa_loc.novi_trusted_li.includes($idaa_loc.novi_uuid)) {
$ae_loc.access_type = 'trusted';
$ae_loc.super_access = false;
$ae_loc.manager_access = false;
$ae_loc.administrator_access = false;
$ae_loc.trusted_access = true;
$ae_loc.public_access = true;
$ae_loc.authenticated_access = true;
$ae_loc.anonymous_access = true;
// NOTE: Check if the novi_uuid is in the novi_trusted_li list
if ($idaa_loc.novi_trusted_li) {
if ($idaa_loc.novi_trusted_li.includes($idaa_loc.novi_uuid)) {
$ae_loc.access_type = 'trusted';
$ae_loc.super_access = false;
$ae_loc.manager_access = false;
$ae_loc.administrator_access = false;
$ae_loc.trusted_access = true;
$ae_loc.public_access = true;
$ae_loc.authenticated_access = true;
$ae_loc.anonymous_access = true;
flag = true;
}
}
// if (!flag) {
// $ae_loc.access_type = 'authenticated';
// $ae_loc.super_access = false;
// $ae_loc.manager_access = false;
// $ae_loc.administrator_access = false;
// $ae_loc.trusted_access = false;
// $ae_loc.public_access = false;
// $ae_loc.authenticated_access = true;
// $ae_loc.anonymous_access = true;
// // Resetting these just in case...
// $idaa_loc.bb.qry__hidden == 'not_hidden';
// $idaa_loc.bb.qry__enabled == 'enabled';
// }
}
}