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 UpdateTeam permission support #2994

Merged
merged 1 commit into from Mar 1, 2022

Conversation

mithmatt
Copy link
Collaborator

@mithmatt mithmatt commented Feb 26, 2022

Describe your changes :

See #2950

This supports creation of a role and adding UpdateTeam permission to the role.
Any user that has this role can update team composition of users

Type of change :

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Frontend Preview (Screenshots) :

For frontend related change, please link screenshots of your changes preview! Optional for backend related changes.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my own.
  • I have tagged my reviewers below.
  • I have commented on my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • All new and existing tests passed.

Reviewers

Backend: @sureshms @harshach

@github-actions
Copy link

Schema Change Detected. Needs ingestion-core version bump

Please run make core_bump_version_dev in the project's root and commit the changes to _version.py in this PR. Please ignore if this has been handled already.

@@ -29,8 +29,8 @@
import org.junit.jupiter.api.Test;
import org.openmetadata.catalog.entity.teams.Team;

@Slf4j
/** This test provides examples of how to use applyPatch */
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was being flagged as a dangling comment by the IDE

@@ -92,6 +92,7 @@ void get_permissions(String username, Map<MetadataOperation, Boolean> expectedOp
put(MetadataOperation.UpdateOwner, Boolean.TRUE);
put(MetadataOperation.UpdateTags, Boolean.TRUE);
put(MetadataOperation.DecryptTokens, Boolean.TRUE);
put(MetadataOperation.UpdateTeam, Boolean.TRUE);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Admin has access to UpdateTeam

@mithmatt mithmatt marked this pull request as draft February 26, 2022 04:44
@github-actions
Copy link

github-actions bot commented Mar 1, 2022

The Java checkstyle failed.

Please run mvn googleformatter:format@reformat-sources in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Java code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@mithmatt mithmatt force-pushed the update_team_support branch 2 times, most recently from be834fa to 9a17192 Compare March 1, 2022 08:10
@mithmatt mithmatt marked this pull request as ready for review March 1, 2022 08:12
@sonarcloud
Copy link

sonarcloud bot commented Mar 1, 2022

[open-metadata-ingestion] 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

@sonarcloud
Copy link

sonarcloud bot commented Mar 1, 2022

[catalog] 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 1 Code Smell

92.4% 92.4% Coverage
0.0% 0.0% Duplication

@@ -179,6 +179,11 @@ public static EntityReference withHref(UriInfo uriInfo, EntityReference ref) {
return ref.withHref(href);
}

public static boolean shouldHaveOwner(@NonNull String entityType) {
// Team does not have an owner. (yet?)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We may need to introduce this someday...

Team owner => manager of the team

Copy link
Contributor

@vivekratnavel vivekratnavel left a comment

Choose a reason for hiding this comment

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

+1 LGTM

@harshach harshach merged commit 374eae4 into open-metadata:main Mar 1, 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.

None yet

3 participants