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

[Workspace] Add permission tab to workspace create update page #6378

Merged

Conversation

wanglam
Copy link
Contributor

@wanglam wanglam commented Apr 9, 2024

Description

This PR is for adding permission tab to workspace create and update page. There are mainly two parts will be included in this PR:

  1. Allow workspace update with partial attributes
  2. Add workspace permission tab to workspace create and update page

Issues Resolved

#6380

Screenshot

image image

Testing the changes

  1. Clone code to local and run yarn osd bootstrap
  2. Modify config/opensearch_dashboards.yml and add below configs
workspace.enabled: true
savedObjects.permission.enabled: true

3.Run yarn start --no-base-path to start OSD server
4. Login OSD and go to workspace create page
5. Fill workspace form and add permission setting
image
6. Click create and the new workspace will be created
7. Go to internal user create page and create a test-user like below image
image
8. Login with test-user in another browser and go to workspace list page
image
It will display test-workspace we added before.
9. Click the pencil icon on the right of test-workspace and go to workspace update page
10.Add some description in workspace update page
image
It will show Invalid workspace permission toast for test-user after Save changes clicked
11. Login with workspace creator user and go to workspace update page
12. Update test-user with Admin permission
image
13. Login with test-user and go to workspace update page, workspace description can be updated now.

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@wanglam wanglam changed the title Add workspace form permission tab [Workspace] Add permission tab to workspace form Apr 9, 2024
@wanglam wanglam changed the title [Workspace] Add permission tab to workspace form [Workspace] Add permission tab to workspace create update page Apr 9, 2024
@wanglam wanglam force-pushed the add-workspace-form-permission-tab branch from dc0928c to aeb2701 Compare April 9, 2024 06:42
Copy link

codecov bot commented Apr 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.58%. Comparing base (b619ccb) to head (b18d051).
Report is 1 commits behind head on main.

❗ Current head b18d051 differs from pull request most recent head 519915f. Consider uploading reports for the commit 519915f to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #6378       +/-   ##
===========================================
+ Coverage   45.18%   55.58%   +10.40%     
===========================================
  Files        1656     1199      -457     
  Lines       33591    24259     -9332     
  Branches     6385     4087     -2298     
===========================================
- Hits        15177    13485     -1692     
+ Misses      17244    10133     -7111     
+ Partials     1170      641      -529     
Flag Coverage Δ
Windows_2 55.58% <ø> (?)
Windows_3 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wanglam wanglam force-pushed the add-workspace-form-permission-tab branch from aeb2701 to 6d6cb4e Compare April 9, 2024 07:54
@Flyingliuhub
Copy link
Member

@wanglam Do we consider that if we only have the front security plugin, is it suitable for different authentication methods, such as identity center authentication?

@wanglam
Copy link
Contributor Author

wanglam commented Apr 16, 2024

@Flyingliuhub For identity center authentication, the user id or group will be exists in request. We can read the user and group info from it and check if it's match the permission settings in workspace configuration. It's the same as other cases. I think it will work fine.

SuZhou-Joe
SuZhou-Joe previously approved these changes Apr 16, 2024
Copy link
Member

@SuZhou-Joe SuZhou-Joe left a comment

Choose a reason for hiding this comment

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

LGTM

Flyingliuhub
Flyingliuhub previously approved these changes Apr 16, 2024
@wanglam wanglam dismissed stale reviews from Flyingliuhub and SuZhou-Joe via 519915f April 17, 2024 01:04
Copy link
Member

@SuZhou-Joe SuZhou-Joe left a comment

Choose a reason for hiding this comment

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

LGTM

@SuZhou-Joe SuZhou-Joe merged commit d911fa7 into opensearch-project:main Apr 17, 2024
65 checks passed
wanglam added a commit to wanglam/OpenSearch-Dashboards that referenced this pull request Apr 17, 2024
…earch-project#6378)

* Allow workspace update with partial attirbutes

Signed-off-by: Lin Wang <[email protected]>

* Add permissions tab for workspace creator and update page

Signed-off-by: Lin Wang <[email protected]>

* Add change log for adding permission tab

Signed-off-by: Lin Wang <[email protected]>

* Optimize permissions to permissions settings convertation

Signed-off-by: Lin Wang <[email protected]>

* Address PR comments

Signed-off-by: Lin Wang <[email protected]>

* Update comments for getPermissionModeId

Signed-off-by: Lin Wang <[email protected]>

---------

Signed-off-by: Lin Wang <[email protected]>
wanglam added a commit to wanglam/OpenSearch-Dashboards that referenced this pull request Apr 17, 2024
…earch-project#6378)

* Allow workspace update with partial attirbutes

Signed-off-by: Lin Wang <[email protected]>

* Add permissions tab for workspace creator and update page

Signed-off-by: Lin Wang <[email protected]>

* Add change log for adding permission tab

Signed-off-by: Lin Wang <[email protected]>

* Optimize permissions to permissions settings convertation

Signed-off-by: Lin Wang <[email protected]>

* Address PR comments

Signed-off-by: Lin Wang <[email protected]>

* Update comments for getPermissionModeId

Signed-off-by: Lin Wang <[email protected]>

---------

Signed-off-by: Lin Wang <[email protected]>
wanglam added a commit to ruanyl/OpenSearch-Dashboards that referenced this pull request Apr 17, 2024
…earch-project#6378) (#333)

* Allow workspace update with partial attirbutes



* Add permissions tab for workspace creator and update page



* Add change log for adding permission tab



* Optimize permissions to permissions settings convertation



* Address PR comments



* Update comments for getPermissionModeId



---------

Signed-off-by: Lin Wang <[email protected]>
raintygao pushed a commit to raintygao/OpenSearch-Dashboards that referenced this pull request Apr 19, 2024
…earch-project#6378) (opensearch-project#333)

* Allow workspace update with partial attirbutes



* Add permissions tab for workspace creator and update page



* Add change log for adding permission tab



* Optimize permissions to permissions settings convertation



* Address PR comments



* Update comments for getPermissionModeId



---------

Signed-off-by: Lin Wang <[email protected]>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 22, 2024
* Allow workspace update with partial attirbutes

Signed-off-by: Lin Wang <[email protected]>

* Add permissions tab for workspace creator and update page

Signed-off-by: Lin Wang <[email protected]>

* Add change log for adding permission tab

Signed-off-by: Lin Wang <[email protected]>

* Optimize permissions to permissions settings convertation

Signed-off-by: Lin Wang <[email protected]>

* Address PR comments

Signed-off-by: Lin Wang <[email protected]>

* Update comments for getPermissionModeId

Signed-off-by: Lin Wang <[email protected]>

---------

Signed-off-by: Lin Wang <[email protected]>
(cherry picked from commit d911fa7)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
SuZhou-Joe pushed a commit that referenced this pull request Apr 22, 2024
#6578)

* Allow workspace update with partial attirbutes

Signed-off-by: Lin Wang <[email protected]>

* Add permissions tab for workspace creator and update page

Signed-off-by: Lin Wang <[email protected]>

* Add change log for adding permission tab

Signed-off-by: Lin Wang <[email protected]>

* Optimize permissions to permissions settings convertation

Signed-off-by: Lin Wang <[email protected]>

* Address PR comments

Signed-off-by: Lin Wang <[email protected]>

* Update comments for getPermissionModeId

Signed-off-by: Lin Wang <[email protected]>

---------

Signed-off-by: Lin Wang <[email protected]>
(cherry picked from commit d911fa7)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants