Skip to content

feat(roles): add roles feature to DataHub #5767

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

Merged
merged 14 commits into from
Aug 31, 2022

Conversation

aditya-radhakrishnan
Copy link
Contributor

@aditya-radhakrishnan aditya-radhakrishnan commented Aug 30, 2022

Screenshots

New Permissions Screen with Roles
image

Batch Assigning a Role
image

Popup when Viewing a Role
image

Popup when Viewing a Policy
image

User List
image

User List when Assigning a Role
image

User Profile with Role Indicated
image

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@aditya-radhakrishnan aditya-radhakrishnan changed the title Ar roles feat(roles): add roles feature to DataHub Aug 30, 2022
@github-actions
Copy link

github-actions bot commented Aug 30, 2022

Unit Test Results (build & test)

517 tests  +8   517 ✔️ +8   8m 23s ⏱️ -5s
121 suites +2       0 💤 ±0 
121 files   +2       0 ±0 

Results for commit 78a0d27. ± Comparison against base commit 134ca67.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Aug 30, 2022

Unit Test Results (metadata ingestion)

    7 files  ±0      7 suites  ±0   55m 42s ⏱️ + 2m 2s
661 tests ±0  655 ✔️  - 2  3 💤 ±0  3 +2 
707 runs  ±0  698 ✔️  - 2  6 💤 ±0  3 +2 

For more details on these failures, see this check.

Results for commit 78a0d27. ± Comparison against base commit 134ca67.

♻️ This comment has been updated with latest results.


assertTrue(_resolver.get(_dataFetchingEnvironment).join());
// Both actors exist and should be assigned to the role
verify(_entityClient, times(2)).ingestProposal(any(), any());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor: can we do better than "any()" comparisons here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added checks for authentication, the proposal might be a bit harder...

const displayName = entityRegistry.getDisplayName(EntityType.CorpUser, user);
const isNativeUser: boolean = user.isNativeUser as boolean;
const shouldShowPasswordReset: boolean = canManageUserCredentials && isNativeUser;
const userRelationships = user.relationships?.relationships;
const userRole = userRelationships && userRelationships.length > 0 && (userRelationships[0]?.entity as DataHubRole);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm slightly confused by this - why are we finding the userRole inside userRelationships?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh are you saying we should just resolve the role on the graphql side and not in relationships? this is the same pattern as groups. This implementation also might be confusing since right now we're enforcing the invariant of a single role but it could be a list in the future

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah I feel that since we have RoleMembership we should have a roleMembershiip field on the user in the long run

Copy link
Collaborator

@jjoyce0510 jjoyce0510 left a comment

Choose a reason for hiding this comment

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

Just a few things remaining..

Copy link
Collaborator

@jjoyce0510 jjoyce0510 left a comment

Choose a reason for hiding this comment

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

Thanks Aditya!

@jjoyce0510 jjoyce0510 merged commit 73cd2f9 into datahub-project:master Aug 31, 2022
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