Copied staff collections: the unit fixture's roles field holds a list (after the rebase on K-1)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
c9540d291a
commit
a743479276
@@ -774,7 +774,7 @@ export function accountRulesSuite(twoFactor: boolean): void {
|
||||
test('a copied collection: the plugin\'s rule for ITS slug goes in front of every rule it brought; nothing is replaced', async () => {
|
||||
const mk = (slug: string, rule: unknown) => markedStaffRule(rule as () => unknown, slug)
|
||||
const access = { create: mk('agents', staffCreateAccess), delete: mk('agents', staffCreateAccess), read: mk('agents', staffReadAccess), update: mk('agents', staffUpdateAccess('agents')) }
|
||||
const pluginRoles = () => ({ name: 'roles', type: 'select', options: ['user', 'editor', 'admin'] }) as { access?: { update?: (a: unknown) => unknown }; name: string; options: string[]; type: string }
|
||||
const pluginRoles = () => ({ name: 'roles', type: 'select', hasMany: true, options: ['user', 'editor', 'admin'] }) as { access?: { update?: (a: unknown) => unknown }; name: string; options: string[]; type: string }
|
||||
const agents = { slug: 'agents', access, auth: true, custom: { ipalAccountRules: { slug: 'agents', applied: Object.keys(access), ownRoles: false }, ipalAccounts: { slug: 'agents', staff: true } }, endpoints: [], fields: [pluginRoles()], hooks: { beforeOperation: [buildPasswordRuleHook()] } }
|
||||
const nobody = () => false
|
||||
const copy = { ...agents, slug: 'copy', endpoints: [], fields: [pluginRoles()] }
|
||||
|
||||
Reference in New Issue
Block a user