This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
Add access control with pai identity provider #210
Labels
enhancement
New feature or request
Milestone
Introduction
PAI identity provider offers API can help marketplace do access control user by user, which is a big step to make marketplace a place user can store or share there work.
Issues / Motivations
Proposals / Solutions
@TobeyQin summarized a table about user authority management rules.

@debuggy and I addressed 6 parts to help marketplace have access control capability.
marketplace item schema change: add groupList, isPublic, isPrivate property to it. [MP restserver] marketplace item schema add access control fileds #213
/items, /items/{itemId}, /storage/blobs, /users(deperacated) should be under access control. (MP APIs) [MP restserver] Add access control to APIs #214
/items support get request to list marketplace items can be viewed by user, and post request to add new item.
/items/{itemId} support get, update, delete specific item, the user access check process is similar, following graph shows authentication check process, the main difference is process logic and response meaning.
/storage/blobs and /users(deperacated) apis are admin management api, should add check isAdmin logic (if user in admin group or offer by idp API /users/{username} user info "isAdmin") check, if not admin, should return 403 forbidden, or regular function will be performed.
Offer /items?type=my get query [MP restserver] Add type=my handler to /items API #215
Internally convert to author == username filter query
Make "Delete" button under access control [MP webportal] Add access control to "Delete" button in item detail #216
Check with (item.author==username or user.isAdmin) locally, if no delete authorization, the delete button should be disabled (hide or grayed). OnClick the enabled button, webportal will send a delete request to /items/{itemId} api, the api will check auth again. If response 200 OK, webportal should show a success delete info and remove this item locally. Otherwise, webportal should prompt an error. Backend db consistency issue ?
Make "Copy" button under access control
Because of "Copy" and "View" are considered as same privilege level, if user can view an item locally, "Copy" button should be enabled as well (may be as same positon as "Delete" button). OnClick the "Copy" button, webportal should show a rename box (and more button to change other metadata), and assemble new metadata with original template, then send a post request to /items/ api, the api will check auth. Auto rename if copy with no rename
Add access control info in create template process
Add checkboxes to select template is Private/Public/Shared, if shared, user can add groups shared with, webportal will get /groups api to support groupList suggestion.
function by function
[Name + description] job type and work load
Work Plan
Demo
Test cases
The text was updated successfully, but these errors were encountered: