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 leaving the organization #6422

Merged
merged 22 commits into from
Sep 22, 2023
Merged

Fix leaving the organization #6422

merged 22 commits into from
Sep 22, 2023

Conversation

Marishka17
Copy link
Contributor

@Marishka17 Marishka17 commented Jul 4, 2023

Motivation and context

Users should have the option to leave the organization.

How has this been tested?

Added REST API tests, updated OPA tests

Checklist

  • I submit my changes into the develop branch
  • I have added a description of my changes into the CHANGELOG file
    - [ ] I have updated the documentation accordingly
  • I have added tests to cover my changes
    - [ ] I have linked related issues (see GitHub docs)
  • I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@Marishka17 Marishka17 requested a review from bsekachev as a code owner July 4, 2023 15:26
@Marishka17 Marishka17 requested review from sizov-kirill and removed request for bsekachev July 4, 2023 15:42
allow {
input.scope == utils.DELETE
input.resource.is_active
utils.is_sandbox
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kirill-sizov, In case of deleting a membership, the environment will never be a sandbox. https://github.com/opencv/cvat/blob/9148234a159c5d5e193e1fcd785ed7010bf950b7/cvat/apps/iam/permissions.py#L61C29-L61C29

Copy link
Contributor

@sizov-kirill sizov-kirill left a comment

Choose a reason for hiding this comment

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

LGTM, but if tests are not supposed to be in this PR need to create an issue for it just to not forget about it

@codecov
Copy link

codecov bot commented Jul 7, 2023

Codecov Report

Merging #6422 (10969ca) into develop (26693dd) will decrease coverage by 0.01%.
The diff coverage is 66.66%.

@@             Coverage Diff             @@
##           develop    #6422      +/-   ##
===========================================
- Coverage    82.50%   82.49%   -0.01%     
===========================================
  Files          370      370              
  Lines        39861    39862       +1     
  Branches      3559     3560       +1     
===========================================
  Hits         32886    32886              
- Misses        6975     6976       +1     
Components Coverage Δ
cvat-ui 77.55% <50.00%> (-0.01%) ⬇️
cvat-server 86.84% <100.00%> (+<0.01%) ⬆️

input.resource.user.id == input.auth.user.id
not {
organizations.OWNER,
organizations.MAINTAINER
Copy link
Contributor

Choose a reason for hiding this comment

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

@Marishka17 , why cannot maintainer leave the organization?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nmanovic, For me, maintainer should also be able to leave the organization. But we have here and here such limitations..

Copy link
Contributor

Choose a reason for hiding this comment

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

The idea behind the rule was a maintainer cannot delete another maintainer. Maintainers should be possible to leave the organization for sure.

@Marishka17 Marishka17 marked this pull request as draft July 19, 2023 09:10
@Marishka17 Marishka17 changed the title Fix leaving the organization [WIP] Fix leaving the organization Jul 19, 2023
@Marishka17 Marishka17 marked this pull request as ready for review September 14, 2023 12:32
@Marishka17 Marishka17 changed the title [WIP] Fix leaving the organization [Do not merge] Fix leaving the organization Sep 14, 2023
@Marishka17 Marishka17 requested a review from mdacoca as a code owner September 15, 2023 12:33
@Marishka17 Marishka17 changed the title [Do not merge] Fix leaving the organization Fix leaving the organization Sep 15, 2023
@Marishka17 Marishka17 requested a review from nmanovic September 15, 2023 12:40
@Marishka17
Copy link
Contributor Author

@nmanovic, Could you please take a look?

@nmanovic nmanovic requested review from klakhov and removed request for azhavoro, SpecLad and mdacoca September 20, 2023 12:13
@nmanovic
Copy link
Contributor

@klakhov , could you please look at the PR? I don't like window.location.reload(). Can we avoid it?

@nmanovic nmanovic merged commit adc8895 into develop Sep 22, 2023
32 checks passed
@nmanovic nmanovic deleted the mk/fix_ability_to_leave_org branch September 22, 2023 13:16
@azhavoro azhavoro mentioned this pull request Sep 25, 2023
mikhail-treskin pushed a commit to retailnext/cvat that referenced this pull request Oct 25, 2023
Users should have the option to leave the organization.
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.

4 participants