Explorar o código

feat(core): Automatically assign Customer role to all new Channels

Michael Bromley %!s(int64=6) %!d(string=hai) anos
pai
achega
da826f29af
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      packages/core/src/api/resolvers/admin/channel.resolver.ts

+ 2 - 0
packages/core/src/api/resolvers/admin/channel.resolver.ts

@@ -40,7 +40,9 @@ export class ChannelResolver {
     async createChannel(@Args() args: MutationCreateChannelArgs): Promise<Channel> {
         const channel = await this.channelService.create(args.input);
         const superAdminRole = await this.roleService.getSuperAdminRole();
+        const customerRole = await this.roleService.getCustomerRole();
         await this.roleService.assignRoleToChannel(superAdminRole.id, channel.id);
+        await this.roleService.assignRoleToChannel(customerRole.id, channel.id);
         return channel;
     }