Skip to content

Access to params in permissions #869

@Natchii59

Description

@Natchii59

How I can access my Mutation/Query params to define my permissions.
For example, I can only put my id in the userId attribute which is passed as a parameter.

export const channelsPermissions: Permissions<null, Subjects, ChannelActions> =
  {
    everyone({ can, user }) {
      // const params = ???

      can(ChannelActions.join, Channel, {
        type: ChannelType.PUBLIC
      })
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions