Stabilized hierarchical permissions and implemented strict visibility gating.

Standardized access level hierarchy (super > manager > administrator > trusted) and added hierarchical comparison utilities to 'ae_util'.

Refactored IDAA layout to use an 'Upgrade-Only' permission strategy, preventing context-specific identifications from downgrading global Manager privileges.

Implemented strict gated filtering in the Journal Entry list: hidden and disabled items now correctly require both the appropriate hierarchical role (Trusted/Admin) AND active Edit Mode.
This commit is contained in:
Scott Idem
2026-02-16 17:12:24 -05:00
parent fb724411d3
commit f96f7069a4
8 changed files with 95 additions and 121 deletions

View File

@@ -286,11 +286,11 @@ async function _refresh_journal_li_background({
let promise;
if (qry_person_id) {
const search_query: any = {
and: [{ field: 'person_id_random', op: 'eq', value: qry_person_id }]
and: [{ field: 'person_id', op: 'eq', value: qry_person_id }]
};
if (for_obj_id)
search_query.and.push({
field: `${for_obj_type}_id_random`,
field: `${for_obj_type}_id`,
op: 'eq',
value: for_obj_id
});
@@ -344,7 +344,7 @@ async function _refresh_journal_li_background({
load_ae_obj_li__journal_entry({
api_cfg,
for_obj_type: 'journal',
for_obj_id: journal.journal_id_random,
for_obj_id: journal.journal_id,
enabled,
hidden,
limit,
@@ -396,7 +396,7 @@ export async function create_ae_obj__journal({
api_cfg: api_cfg,
obj_type: 'journal',
fields: {
account_id_random: account_id,
account_id: account_id,
...data_kv
},
params: params,
@@ -613,7 +613,7 @@ export async function qry__journal({
if (journal_id) {
// Assuming journal_id here is actually the account_id as per original usage context
search_query.and.push({
field: 'account_id_random',
field: 'account_id',
op: 'eq',
value: journal_id
});
@@ -797,7 +797,6 @@ async function _process_generic_props<T extends Record<string, any>>({
// --- Common Transformations ---
// 1. Standardize ID and other '_random' fields
// The API often returns fields like 'person_id_random', which need to be aliased to 'person_id'.
for (const key in processed_obj) {
if (key.endsWith('_random')) {
const newKey = key.slice(0, -7); // Remove '_random' suffix
@@ -805,7 +804,7 @@ async function _process_generic_props<T extends Record<string, any>>({
}
}
// Ensure 'id' is set from '[obj_type]_id_random'
const randomIdKey = `${obj_type}_id_random`;
const randomIdKey = `${obj_type}_id`;
if (processed_obj[randomIdKey]) {
(processed_obj as any).id = processed_obj[randomIdKey];
}