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

Add shared role managing event handler and event listener #255

Merged
merged 17 commits into from
Oct 23, 2023

Conversation

AnuradhaSK
Copy link
Contributor

@AnuradhaSK AnuradhaSK commented Oct 8, 2023

Purpose

$Subject

SharedRoleMgtHandler handles:

  • On creating a role with application audience in the primary organization, created the shared roles in the organizations where the app is already shared
  • On shared app creation in sub-organization
  1. Create application audience roles defined in the parent application
  2. Create organization audience roles if the shared app uses them and if the same organization role is not availble in the sub-org due to any other shared app

config to enable handler:

[[event_handler]]
name= "SharedRoleMgtHandler"
subscriptions =["POST_ADD_ROLE_V2_EVENT", "POST_SHARE_APPLICATION"]

SharedRoleMgtListener handles:

  • On deleting a shared app(may be due to unsharing the app from given org/ delete the main app and due to that deleting shared app) deleting roles with organization audience in app-shared organizations if no other shared app use them

  • On main application's role audience/role list update, track the change in preUpdate listerner and set into the threadlocal varibales. Add/ Delete roles from shared organizations

Part of: wso2/product-is#16363

How other Shared Role management happens:

  1. On Rolename update of main role -> Rename shared roles names at role mgt DAO layer
  2. On deletion of main role -> Handled shared role deletion in role mgt DAO layer
  3. On changing permissions of the role in the parent organization -> Permission always assigned to the main role not to the shared role
  4. On unsharing an application from a sub-organization -> Role mgt service level method to delete roles by app id
  5. On deleting a shared B2B application in a parent organization with roles -> Role mgt service level method to delete roles by app id

Depends on:

@AnuradhaSK AnuradhaSK changed the title Add shared role managing event handler Add shared role managing event handler and event listener Oct 18, 2023
@AnuradhaSK AnuradhaSK force-pushed the shared-role-mgt-handler branch 2 times, most recently from 8d9405f to c5581d6 Compare October 20, 2023 16:04
@AnuradhaSK AnuradhaSK marked this pull request as ready for review October 20, 2023 16:10
thanujalk
thanujalk previously approved these changes Oct 21, 2023
dewniMW pushed a commit to dewniMW/identity-organization-management-1 that referenced this pull request Oct 22, 2023
dewniMW pushed a commit to dewniMW/identity-organization-management-1 that referenced this pull request Oct 22, 2023
@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/6614732606

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/6614732606
Status: failure

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/6616697677

@AnuradhaSK
Copy link
Contributor Author

PR builder failure is an intermittent failure. passing locally. Hence merging
Screenshot 2023-10-23 at 23 20 50

@AnuradhaSK AnuradhaSK merged commit ca78d4c into wso2-extensions:main Oct 23, 2023
2 checks passed
@AnuradhaSK AnuradhaSK deleted the shared-role-mgt-handler branch October 23, 2023 17:51
@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/6616697677
Status: failure

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.

5 participants