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

[To Main] DESENG-478 - Override _add_tenant_filter to check in user group membership table for tenant mapping #2495

Merged
merged 4 commits into from
May 8, 2024

Conversation

ratheesh-aot
Copy link
Collaborator

@ratheesh-aot ratheesh-aot commented May 7, 2024

Issue #: https://apps.itsm.gov.bc.ca/jira/browse/DESENG-478

Description of changes:

  • Tested users can belong to more than one tenant.
  • Override the default tenant filter for the staff_user table to check with the user_group_membership table.

Note : tenant_id is left as it is in the staff_user table to track the tenant_id of the user when it is created first time.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the met-public license (Apache 2.0).

@ratheesh-aot ratheesh-aot changed the title DESENG-478 - Override _add_tenant_filter to check in user group membership table for tenant mapping [To Main] DESENG-478 - Override _add_tenant_filter to check in user group membership table for tenant mapping May 7, 2024
Copy link
Collaborator

@Baelx Baelx left a comment

Choose a reason for hiding this comment

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

Please just remove the print statement before merging!


# Check that staff admins can see users within the same tenant
_, claims = setup_admin_user_and_claims
headers = factory_auth_header(jwt=jwt, claims=claims)
rv = client.get('/api/user/', headers=headers, content_type=ContentType.JSON.value)
assert rv.status_code == HTTPStatus.OK
print(rv.json.get('items'))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be removed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Missed it ! :) .. Will remove

Copy link

sonarqubecloud bot commented May 8, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@ratheesh-aot ratheesh-aot merged commit 7d064cd into bcgov:main May 8, 2024
10 of 11 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