mirror of
https://github.com/logto-io/logto.git
synced 2024-12-30 20:33:54 -05:00
refactor(schemas): remove invite member scope from tenant member role (#5578)
This commit is contained in:
parent
2ae8c112f5
commit
3cc6d4b4f4
2 changed files with 21 additions and 6 deletions
|
@ -0,0 +1,20 @@
|
|||
import { sql } from '@silverhand/slonik';
|
||||
|
||||
import type { AlterationScript } from '../lib/types/alteration.js';
|
||||
|
||||
const alteration: AlterationScript = {
|
||||
up: async (pool) => {
|
||||
await pool.query(sql`
|
||||
delete from organization_role_scope_relations
|
||||
where tenant_id = 'admin' and organization_role_id = 'member' and organization_scope_id = 'invite-member';
|
||||
`);
|
||||
},
|
||||
down: async (pool) => {
|
||||
await pool.query(sql`
|
||||
insert into organization_role_scope_relations (tenant_id, organization_role_id, organization_scope_id)
|
||||
values ('admin', 'member', 'invite-member');
|
||||
`);
|
||||
},
|
||||
};
|
||||
|
||||
export default alteration;
|
|
@ -155,10 +155,5 @@ export const getTenantRole = (role: TenantRole): Readonly<OrganizationRole> =>
|
|||
export const tenantRoleScopes: Readonly<Record<TenantRole, Readonly<TenantScope[]>>> =
|
||||
Object.freeze({
|
||||
[TenantRole.Admin]: allTenantScopes,
|
||||
[TenantRole.Member]: [
|
||||
TenantScope.ReadData,
|
||||
TenantScope.WriteData,
|
||||
TenantScope.DeleteData,
|
||||
TenantScope.InviteMember,
|
||||
],
|
||||
[TenantRole.Member]: [TenantScope.ReadData, TenantScope.WriteData, TenantScope.DeleteData],
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue