Skip to content

MCP remove_permissions_from_assortment and remove_shops_from_assortment report success and delete nothing #695

Description

@Justinvolved

Describe the bug

remove_permissions_from_assortment answers succeeded: 1, failed: 0 and leaves the permission row in place. remove_shops_from_assortment does the same for the shop relation. The matching assign_* tools work. A caller that revokes a user group's access to an assortment, or takes an assortment off a shop, is told it succeeded while the grant stays active.

To Reproduce

  1. save_user_groups {"groups":[{"id":0,"name":"TEST-GROUP","parentGroupId":0}]}. Note the group id G.
  2. save_assortments {"assortments":[{"id":"TEST-ASRT","name":"TEST-ASRT","active":false}]}.
  3. assign_permissions_to_assortment {"permissions":[{"assortmentId":"TEST-ASRT","userId":G}]}.
  4. get_assortment_permissions {"assortmentId":"TEST-ASRT"}: one row.
  5. remove_permissions_from_assortment {"permissions":[{"assortmentId":"TEST-ASRT","userId":G}]} (also tried with the autoId from step 4).
  6. get_assortment_permissions again, and SELECT * FROM EcomAssortmentPermissions WHERE AssortmentPermissionAssortmentID='TEST-ASRT'.
  7. assign_shops_to_assortment {"relations":[{"assortmentId":"TEST-ASRT","shopId":"SHOP1"}]}, then remove_shops_from_assortment with the same payload, then SELECT * FROM EcomAssortmentShopRelations WHERE AssortmentShopRelationAssortmentID='TEST-ASRT'.

Observed (DW 10.28.11, MCP add-in 0.6.0-BETA):

assign_permissions_to_assortment   -> {"succeeded":1,"failed":0,"skipped":0,"errors":[]}
get_assortment_permissions         -> {"count":1,"data":[{"autoId":1,"assortmentId":"TEST-ASRT","userId":100104}]}
remove_permissions_from_assortment -> {"succeeded":1,"failed":0,"skipped":0,"errors":[]}
remove_permissions_from_assortment (with autoId:1) -> {"succeeded":1,"failed":0,"skipped":0,"errors":[]}
get_assortment_permissions         -> {"count":1,"data":[{"autoId":1,"assortmentId":"TEST-ASRT","userId":100104}]}
EcomAssortmentPermissions          -> TEST-ASRT | 100104 | 1   (row still present)

assign_shops_to_assortment   -> succeeded 1; EcomAssortmentShopRelations: TEST-ASRT | SHOP1 | 1
remove_shops_from_assortment -> {"succeeded":1,"failed":0,"skipped":0,"errors":[]}
EcomAssortmentShopRelations  -> TEST-ASRT | SHOP1 | 1   (row still present)

delete_assortments on the assortment removes both rows, so the only way to revoke one grant over MCP is to delete and rebuild the whole assortment.

Expected behavior

The named permission row and shop relation are deleted, and get_assortment_permissions no longer lists them. If a row does not match, the result reports it under skipped or errors instead of succeeded.

Environment

  • Dynamicweb 10.28.11 (.NET 10 hosting)
  • MCP add-in 0.6.0-BETA

Activity

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

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