Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 14x 1x | import {model} from '@feasibleone/blong';
/**
* accessAclModel — the explicit ACL rules (Browse/New/Open).
*
* One row grants (`allow`) or refuses (`deny`) one action on one target for one
* principal — the *explicit* half of the record-level ACL:
*
* - **principal** — a user, role, unit or capability. A rule on a role/unit is
* what a user inherits, so the same page administers every level of the
* hierarchy.
* - **action** — the `access_action` resource, i.e. the guarded method.
* - **target kind** — `scope` (every record linked to that unit/organization
* through the table's declared scope edges, descendants included) or `record`
* (a single row, typically an exception).
* - **effect** — `allow`, or `deny`, which always wins over anything an
* implicit `hasScope` grant or another rule would allow.
*
* The names are joined by `access.acl.find` / `.get` for display; the write
* handlers drop them again so they never reach the table.
*/
export default model(
() =>
async function accessAclModel() {
return {
subject: 'access',
object: 'acl',
objectTitle: 'ACL Rule',
public: true,
nameField: 'acl.targetName',
schema: {
properties: {
acl: {
properties: {
principalId: {
title: 'Principal',
widget: {type: 'dropdown', dropdown: 'access.aclPrincipal'},
},
actionId: {
title: 'Action',
widget: {type: 'dropdown', dropdown: 'access.action'},
},
targetKind: {
title: 'Target Kind',
default: 'scope',
filter: true,
widget: {
type: 'select',
options: [
{value: 'scope', label: 'Scope'},
{value: 'record', label: 'Record'},
{value: 'all', label: 'All records'},
],
},
},
targetId: {
title: 'Target',
widget: {type: 'dropdown', dropdown: 'access.aclTarget'},
},
effect: {
title: 'Effect',
default: 'allow',
filter: true,
widget: {
type: 'select',
options: [
{value: 'allow', label: 'Allow'},
{value: 'deny', label: 'Deny'},
],
},
},
isActive: {
title: 'Active',
type: 'boolean',
filter: true,
default: true,
},
// Joined by the custom find/get handlers.
principalName: {title: 'Principal', readOnly: true},
actionName: {title: 'Action', readOnly: true},
targetName: {title: 'Target', readOnly: true},
},
widget: {
columns: [
'principalName',
'actionName',
'effect',
'targetKind',
'targetName',
'isActive',
],
hidden: ['principalId', 'actionId', 'targetId'],
},
},
},
},
cards: {
browse: {
label: 'ACL Rules',
widgets: ['acl'],
},
edit: {
label: 'ACL Rule',
className: 'col-12 md:col-8',
widgets: [
'acl.principalId',
'acl.actionId',
'acl.targetKind',
'acl.targetId',
'acl.effect',
'acl.isActive',
],
},
},
browser: {
title: 'ACL Rules',
icon: 'pi pi-shield',
},
};
},
);
|