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

chore: adjust technical user role documentation #213

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

Phil91
Copy link
Member

@Phil91 Phil91 commented Dec 2, 2023

Description

Adjusted the upgrade script for the keycloak roles

Why

Currently the role assignment is missing one role, this is added with this pr

Issue

N/A

Checklist

  • I have followed the contributing guidelines
  • I have performed IP checks for added or updated 3rd party libraries
  • I have created and linked IP issues or requested their creation by a committer
  • I have added copyright and license headers, footers (for .md files) or files (for images)
  • I have performed a self-review of my own code
  • I have successfully tested my changes locally
  • I have added tests that prove my changes work
  • I have checked that new and existing tests pass locally with my changes
  • I have commented my code, particularly in hard-to-understand areas

@Phil91
Copy link
Member Author

Phil91 commented Dec 2, 2023

this is the script we should execute on our environments:

WITH users AS (
    SELECT DISTINCT ia.identity_id
    FROM portal.identity_assigned_roles AS ia
        JOIN portal.user_roles AS ur
        ON ia.user_role_id = ur.id
    WHERE ur.user_role = 'Dataspace Discovery'
    AND ia.identity_id NOT IN (
        SELECT DISTINCT ia2.identity_id
        FROM portal.identity_assigned_roles AS ia2
            JOIN portal.user_roles AS ur2
            ON ia2.user_role_id = ur2.id
        WHERE ur2.user_role = 'CX Membership Info'
    )
),
roles_to_insert AS (
    SELECT DISTINCT atu.identity_id, ur.id AS user_role_id
    FROM users AS atu
    CROSS JOIN (
        SELECT id
        FROM portal.user_roles
        WHERE user_role = 'Identity Wallet Management'
    ) AS ur
)
INSERT INTO portal.identity_assigned_roles (identity_id, user_role_id)
SELECT rt.identity_id, rt.user_role_id
FROM roles_to_insert AS rt
LEFT JOIN portal.identity_assigned_roles AS iar
ON rt.identity_id = iar.identity_id AND rt.user_role_id = iar.user_role_id
WHERE iar.identity_id IS NULL;

@Phil91 Phil91 marked this pull request as ready for review December 2, 2023 16:36
@Phil91 Phil91 requested review from evegufy and jjeroch and removed request for evegufy December 2, 2023 16:40
@evegufy evegufy self-requested a review December 5, 2023 17:11
Copy link
Contributor

@evegufy evegufy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Phil91 The initial description here should also get updated for adding Identity Wallet Management to Connector.

And are you certain that you removed entirely the assignment of Identity Wallet Management to ex- App Tech User users, could you please check again?

Copy link

sonarcloud bot commented Dec 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@Phil91
Copy link
Member Author

Phil91 commented Dec 6, 2023

@Phil91 The initial description here should also get updated for adding Identity Wallet Management to Connector.

And are you certain that you removed entirely the assignment of Identity Wallet Management to ex- App Tech User users, could you please check again?

i've adjusted the initial description.
There was one assignment of Identity Wallet Management to App Tech User left as well, this is now removed.

@Phil91 Phil91 requested a review from evegufy December 6, 2023 07:09
@Phil91 Phil91 merged commit 58d5ad3 into release/v1.7.0 Dec 6, 2023
5 checks passed
@Phil91 Phil91 deleted the bugfix/upgrade-script branch December 6, 2023 07:33
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.

2 participants