Prechádzať zdrojové kódy

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

Michael Bromley 6 rokov pred
rodič
commit
da826f29af

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