0
Fork 0
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:
Charles Zhao 2024-03-28 17:56:08 +08:00 committed by GitHub
parent 2ae8c112f5
commit 3cc6d4b4f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 6 deletions

View file

@ -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;

View file

@ -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],
});