Procházet zdrojové kódy

fix(core): Allow CRUD on Channels for non-SuperAdmins with permissions

Relates to #1402
Michael Bromley před 3 roky
rodič
revize
fd2f039463

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

@@ -43,7 +43,7 @@ export class ChannelResolver {
 
     @Transaction()
     @Mutation()
-    @Allow(Permission.SuperAdmin)
+    @Allow(Permission.SuperAdmin, Permission.CreateChannel)
     async createChannel(
         @Ctx() ctx: RequestContext,
         @Args() args: MutationCreateChannelArgs,
@@ -61,7 +61,7 @@ export class ChannelResolver {
 
     @Transaction()
     @Mutation()
-    @Allow(Permission.SuperAdmin)
+    @Allow(Permission.SuperAdmin, Permission.UpdateChannel)
     async updateChannel(
         @Ctx() ctx: RequestContext,
         @Args() args: MutationUpdateChannelArgs,
@@ -75,7 +75,7 @@ export class ChannelResolver {
 
     @Transaction()
     @Mutation()
-    @Allow(Permission.SuperAdmin)
+    @Allow(Permission.SuperAdmin, Permission.DeleteChannel)
     async deleteChannel(
         @Ctx() ctx: RequestContext,
         @Args() args: MutationDeleteChannelArgs,