Skip to content

Commit

Permalink
feat: Example usage of transfer data about specific permission via Se…
Browse files Browse the repository at this point in the history
…tMetadata decorator
  • Loading branch information
AndreSoftwareDeveloper committed Jun 17, 2024
1 parent 853d33e commit 2c65934
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Args, Mutation, Resolver } from "@nestjs/graphql";
import { UseGuards } from "@nestjs/common";
import { SetMetadata, UseGuards } from "@nestjs/common";

import { CreateAdminGroupsService } from "./create.service";
import { CreateAdminGroupsArgs } from "./dto/create.args";
Expand All @@ -13,6 +13,7 @@ export class CreateAdminGroupsResolver {

@Mutation(() => ShowAdminGroups)
@UseGuards(AdminAuthGuards)
@SetMetadata("permission", "create_group")
async core_groups__admin_create(
@Args() args: CreateAdminGroupsArgs
): Promise<ShowAdminGroups> {
Expand Down

0 comments on commit 2c65934

Please sign in to comment.