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

fix(core): Add checks for role presence before granting it #5300

Merged
merged 9 commits into from
Feb 23, 2025

Conversation

aoyako
Copy link
Contributor

@aoyako aoyako commented Jan 31, 2025

Resolves #5246.

Verify that the role is present in the world before assigning it.

Example that should pass:

{
    "Register": {
        "Role": {
            "id": "good_role",
            "permissions": [
                {
                    "name": "CanSetParameters",
                    "payload": null
                }
            ],
            "grant_to": "ed0120E9F632D3034BAB6BB26D92AC8FD93EF878D9C5E69E01B61B4C47101884EE2F99@garden_of_live_flowers"
        }
    }
},
{
    "Grant": {
        "Role": {
            "object": "good_role",
            "destination": "ed0120CE7FA46C9DCE7EA4B125E2E36BDB63EA33073E7590AC92816AE1E861B7048B03@wonderland"
        }
    }
}

Example that should fail:

{
    "Grant": {
        "Role": {
            "object": "bad_role",
            "destination": "ed0120CE7FA46C9DCE7EA4B125E2E36BDB63EA33073E7590AC92816AE1E861B7048B03@wonderland"
        }
    }
}

Signed-off-by: Lohachov Mykhailo <[email protected]>
Signed-off-by: Lohachov Mykhailo <[email protected]>
s8sato
s8sato previously approved these changes Feb 3, 2025
Co-authored-by: Shunkichi Sato <[email protected]>
Signed-off-by: Mykhailo Lohachov <[email protected]>
s8sato
s8sato previously approved these changes Feb 3, 2025
@s8sato s8sato self-assigned this Feb 3, 2025
Signed-off-by: Lohachov Mykhailo <[email protected]>
s8sato
s8sato previously approved these changes Feb 12, 2025
Signed-off-by: Lohachov Mykhailo <[email protected]>
@aoyako aoyako self-assigned this Feb 22, 2025
@aoyako aoyako merged commit b5396e9 into hyperledger-iroha:main Feb 23, 2025
13 of 14 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.

Granting unexisting role
3 participants