Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed empty permission list replace issue in v2 Role patch #495

Merged

Conversation

PasinduYeshan
Copy link
Contributor

@PasinduYeshan PasinduYeshan commented Oct 26, 2023

Currently, when attempting to replace the permissions of a role with an empty list using the provided API endpoint, the existing permissions remain unchanged. This behavior is demonstrated in the following CURL request, where the aim is to clear all permissions associated with a specified role:

curl --location --request PATCH 'https://localhost:9443/scim2/v2/Roles/c3445ed2-a6a9-466b-9796-1094b160770a' \
--header 'Content-Type: application/scim+json' \
--header 'Accept: application/scim+json' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--header 'Cookie: atbv=7701cee0-00fb-4a32-8d5a-ae677f76808c' \
--data '{
    "Operations": [
        {
            "op": "replace",
            "value": {
                "permissions": [
                    
                ]
            }
        }
    ],
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ]
}'

With this fix, the system will now correctly replace the existing permissions in the role, even when the replacement list is empty.

Related Issue

@dewniMW
Copy link
Contributor

dewniMW commented Oct 26, 2023

@PasinduYeshan can you add the git issue?

@AnuradhaSK AnuradhaSK merged commit 20d8dba into wso2-extensions:master Oct 26, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants