Skip to content

Combining permissions with -OR- #2350

Open
@paulo-raca

Description

@paulo-raca

In my project I have resolvers that should be acessible if at least one of multiple conditions is met -- aka "OR".

I'm currently implementing it in a single permission class, but it would be ideal if I could combine them. A few examples:

@strawberry.type
class Mutation:
    @strawberry.mutation(permission=Permissions.SuperAdmin | Permission.ObjectOwner)
    def update_object(self, object_id: ID, changes: Something) -> MutationResult:
        ...
@strawberry.type
class ParentChildRelationship:
    @strawberry.field(permission=Permissions.IsParent | Permissions.IsChild)
    def relationship_details(self) -> Something:
        ...

Feature Request Type

  • Core functionality
  • Alteration (enhancement/optimization) of existing feature(s)
  • New behavior

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions