Skip to content

Delete default permissions does not take in a list #783

Open

Description

@shinchris

Regular permission delete method takes in a singular PermissionRule object, or a list of them. It will delete all the permissions included in the list.

Default permissions delete method only accepts a singular PermissionRule object. It will only delete 1 set of rules maximum. See sample, line 75-79.

Activity

  1. jacalata commented on Jun 7, 2022

    @jacalata
    Contributor

    Code comments currently in permissions_endpoint show that delete_permissions can take either a single rule or a list. We should update delete_default_permissions to do the same.
    # Delete is the only endpoint that doesn't take a list of rules
    # so let's fake it to keep it consistent

  2. jacalata commented on Feb 16, 2023

    @jacalata
    Contributor

    There's quite a few methods to update:
    image

  3. salvuswarez commented on Mar 15, 2023

    @salvuswarez

    Hi there, first time responder, long time user of tsc here and i want to start with you guys are awesome and very much appreciate your work here. I was working through this recently and noticed that to fix it, all that seems to be needed is to apply the same signature and loop logic that is done on the delete permissions method in the permissions endpoint to the default_permissions_endpoint.

    first just update the signature, then add the check and outer loop.
    def delete_default_permission(self, resource: BaseItem, rules: Union[PermissionsRule,List[PermissionsRule]], content_type: Resource) -> None:

    # applying fix so that delete default endpoint can handle a list of rules like the delete permissions endpoint does
    if isinstance(rules,PermissionsRule):
        rules = [rules]
    for rule in rules:
        for capability, mode in rule.capabilities.items():...`
    
  4. github-actions commented on Aug 6, 2026

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this is still relevant, please comment to keep it open.

  5. github-actions commented on Aug 21, 2026

    @github-actions

    Closing due to inactivity. If this is still relevant, please reopen or file a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions