8000 Multiple Abilities => UseAbility should be able to take in arrays · Issue #618 · getjerry/nest-casl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Multiple Abilities => UseAbility should be able to take in arrays #618
Open
@aniketbiprojit

Description

@aniketbiprojit

The implementation of the library either requires coupled permissions on multiple entities or different routes.

Let's say I want to define create on Entity1 and define delete on Entity2 => I will either need to couple the definitions or separate out routes.

Offered solution:

  @UseGuards(JwtAuthGuard, MultiAccessGuard)
  @UseMultiAbility([
    {
      action: Actions.update,
      subject: OrganizationEntity,
      subjectHook: OrganizationHook,
    },
    {
      action: Actions.create,
      subject: OrganizationUserEntity,
    },
    {
      action: Actions.create,
      subject: OrganizationRoleEntity,
    },
  ])

Currently using this solution in a local implementation. Would be good to have it available out of the box.

Similarly for the rest of the proxies.

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

      0