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 admin role mandatory attribute update #497

Merged

Conversation

shashimalcse
Copy link
Contributor

@shashimalcse shashimalcse commented Oct 26, 2023

Previously, the mandatory id attribute of admin role was update using a random UUID. However, in the current role v2 implementation, we set the UUID from the kernel to the UM_HYBRID_ROLE table. Instead of updating the ID attribute of the role with a random UUID, we set the role id attribute by retrieving the UUID from the UM_HYBRID_ROLE table.

Part of wso2/product-is#16363

Comment on lines 93 to 94
throws IdentitySCIMException {
Map<String, String> attributes = new HashMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
throws IdentitySCIMException {
Map<String, String> attributes = new HashMap<>();
throws IdentitySCIMException {
Map<String, String> attributes = new HashMap<>();

* @throws IdentitySCIMException if any error occurs while adding admin role attributes.
*/
public void addAdminRoleMandatoryAttributes(String roleName)
throws IdentitySCIMException {
Copy link
Contributor

Choose a reason for hiding this comment

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

can't we move the line 93 above

public void addAdminRoleMandatoryAttributes(String roleName)
throws IdentitySCIMException {
Map<String, String> attributes = new HashMap<>();
String tenantDomain = IdentityTenantUtil.getTenantDomain(1);
Copy link
Contributor

@AnuradhaSK AnuradhaSK Oct 26, 2023

Choose a reason for hiding this comment

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

Suggested change
String tenantDomain = IdentityTenantUtil.getTenantDomain(1);
String tenantDomain = IdentityTenantUtil.getTenantDomain(<use correct tenant id>);

@shashimalcse shashimalcse merged commit 8428586 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.

2 participants