aboutcode-org / aboutcode-org/scancode.io

REST API: Design for permissions [was: Authentication: can delete project from different user.]

未關閉
#329 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
design-needed enhancement
主要語言
Python
星號
215
分支
203
平均合併
4 天 8 小時
30 天內合併 PR
6

描述

Hi,

I have created two user and each added a unique token. Both user belong to same group with following rights
```
-auth | group | Can view group">auth | group | Can view group
-auth | permission | Can view permission">auth | permission | Can view permission
-auth | user | Can view user">auth | user | Can view user
-authtoken | token | Can view token">authtoken | token | Can view token
-contenttypes | content type | Can view content type">contenttypes | content type | Can view content type
-scan | Can add scan">scan | Can add scan
-scan | Can change scan">scan | Can change scan
-scan | Can delete scan">scan | Can delete scan
-scan | Can view scan">scan | Can view scan
-scanpipe | codebase resource | Can add codebase resource">scanpipe | codebase resource | Can add codebase resource
-scanpipe | codebase resource | Can view codebase resource">scanpipe | codebase resource | Can view codebase resource
-scanpipe | project | Can add project">scanpipe | project | Can add project
-scanpipe | project | Can delete project">scanpipe | project | Can delete project
-scanpipe | project | Can view project">scanpipe | project | Can view project
-scanpipe | project error | Can view project error">scanpipe | project error | Can view project error
-scanpipe | run | Can add run">scanpipe | run | Can add run
-scanpipe | run | Can view run">scanpipe | run | Can view run
```
Then created protect (curl formular based upload and start pipeline with one call) with token from user1 and uploaded an archive. Same for user2 (his token).
Authentication is enabled and when requesting information a valid token is required.

I then tried to delete a project with token from user 2 but a project created with token from user 1.
When the scan still run, I got always a html page with error code 500. I waited longer and when scan was finished tried the same command again (delete project create by different user token).
Expecte: json with error

Result: project was deleted
Expected: error (project should only be deletable with same token as it was created).

Cheers, Stephan

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。