Skip to content

Commit

Permalink
Allow PROPOSAL_GROUPS members to update proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
fpotier authored and Junjiequan committed Jul 23, 2024
1 parent c5a49cb commit fb13ae8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/casl/casl-ability.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Injectable } from "@nestjs/common";
import { Attachment } from "src/attachments/schemas/attachment.schema";
import { JWTUser } from "src/auth/interfaces/jwt-user.interface";
// import { Role } from "src/auth/role.enum";
import configuration from "src/config/configuration";
import { Datablock } from "src/datablocks/schemas/datablock.schema";
import { DatasetClass } from "src/datasets/schemas/dataset.schema";
import { ElasticSearchActions } from "src/elastic-search/dto";
Expand All @@ -24,7 +25,6 @@ import { UserIdentity } from "src/users/schemas/user-identity.schema";
import { UserSettings } from "src/users/schemas/user-settings.schema";
import { User } from "src/users/schemas/user.schema";
import { Action } from "./action.enum";
import configuration from "src/config/configuration";

type Subjects =
| string
Expand Down Expand Up @@ -978,6 +978,7 @@ export class CaslAbilityFactory {
// -------------------------------------
// data instance authorization
can(Action.ProposalsCreateAny, ProposalClass);
can(Action.ProposalsUpdateAny, ProposalClass);
can(Action.ProposalsReadManyAccess, ProposalClass);
can(Action.ProposalsReadOneAccess, ProposalClass, {
ownerGroup: { $in: user.currentGroups },
Expand Down

0 comments on commit fb13ae8

Please sign in to comment.