Skip to content

Commit

Permalink
Merge pull request #1595 from owenlxu/issue_1594
Browse files Browse the repository at this point in the history
feat: 权限相关接口允许项目管理员访问 #1594
  • Loading branch information
owenlxu authored Dec 27, 2023
2 parents be9bc6a + dd3897c commit 7ed2fe8
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 446 deletions.
285 changes: 1 addition & 284 deletions docs/apidoc/auth/permission.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,44 +410,7 @@
|departments|string array|部门id|the department id|
|actions|string array|action id|the action id|

### 更新权限绑定仓库

- API: PUT /auth/api/permission/repo
- 功能说明:
- 中文:更新权限绑定仓库
- English:update permission repo
- input body:

``` json
{
"permissionId":"5ea4f6608c165f702f5bd41e",
"repos":[
"owen",
"tt"
]
}
```
- input 字段说明


|字段|类型|是否必须|默认值|说明|Description|
|---|---|---|---|---|---|
|permissionId|string|||角色主键id|the permission primary key|
|repos|string array||[]|仓库名称列表|the repo name array|

- output:

```
```
- output 字段说明

| 字段|类型|说明|Description|
|---|---|---|---|
|code|bool|错误编码。 0表示success,>0表示失败错误 |0:success, other: failure|
|message|result message|错误消息 |the failure message |
|data | object array | result data,具体字段见创建请求 |the data for response|
|traceId|string|请求跟踪id|the trace id|

### 更新权限绑定用户

Expand Down Expand Up @@ -496,250 +459,4 @@
|code|bool|错误编码。 0表示success,>0表示失败错误 |0:success, other: failure|
|message|result message|错误消息 |the failure message |
|data | bool | the request result |the request result|
|traceId|string|请求跟踪id|the trace id|

### 更新权限绑定角色

- API:PUT /auth/api/permission/role
- API 名称: update_permission_role
- 功能说明:
- 中文:更新权限绑定角色
- English:update permission role

- input body:

``` json
{
"permissionId":"5ea4f6608c165f702f5bd41e",
"rId":[
"ops",
"dev"
]
}
```

- input 字段说明

|字段|类型|是否必须|默认值|说明|Description|
|---|---|---|---|---|---|
|permissionId|string|||角色主键id|the permission primary key|
|rId|string array||[]|角色主键id列表|the role id primary key array|

- output:

```
{
"code":0,
"data":true,
"message":"",
"traceId":""
}
```
- output 字段说明

| 字段|类型|说明|Description|
|---|---|---|---|
|code|bool|错误编码。 0表示success,>0表示失败错误 |0:success, other: failure|
|message|result message|错误消息 |the failure message |
|data | bool | the request result |the request result|
|traceId|string|请求跟踪id|the trace id|


### 更新权限绑定部门

- API:PUT /auth/api/permission/department
- API 名称: update_permission_department
- 功能说明:
- 中文:更新角色绑定部门
- English:update permission department

- input body:

``` json
{
"permissionId":"5ea4f6608c165f702f5bd41e",
"departmentId":[
"ops",
"dev"
]
}
```

- input 字段说明

|字段|类型|是否必须|默认值|说明|Description|
|---|---|---|---|---|---|
|permissionId|string|||角色主键id|the permission primary key|
|departmentId|string array||[]|部门id列表|the department id array|

- output:

```
{
"code":0,
"data":true,
"message":"",
"traceId":""
}
```
- output 字段说明

| 字段|类型|说明|Description|
|---|---|---|---|
|code|bool|错误编码。 0表示success,>0表示失败错误 |0:success, other: failure|
|message|result message|错误消息 |the failure message |
|data | bool | the request result |the request result|
|traceId|string|请求跟踪id|the trace id|

### 更新权限绑定动作

- API:PUT /auth/api/permission/action
- API 名称: update_permission_action
- 功能说明:
- 中文:更新角色绑定动作
- English:update permission department

- input body:

``` json
{
"permissionId":"5ea4f6608c165f702f5bd41e",
"actions":[
"ops",
"dev"
]
}
```

- input 字段说明

|字段|类型|是否必须|默认值|说明|Description|
|---|---|---|---|---|---|
|permissionId|string|||角色主键id|the permission primary key|
|actions|string array||[]|动作列表|the action list|

- output:

```
{
"code":0,
"data":true,
"message":"",
"traceId":""
}
```
- output 字段说明

| 字段|类型|说明|Description|
|---|---|---|---|
|code|bool|错误编码。 0表示success,>0表示失败错误 |0:success, other: failure|
|message|result message|错误消息 |the failure message |
|data | bool | the request result |the request result|
|traceId|string|请求跟踪id|the trace id|


### 更新权限包含路径

- API: PUT /auth/api/permission/includePath
- API 名称: update_include_path
- 功能说明:
- 中文:更新权限包含路径
- English:update permission include path
- input body:

``` json
{
"permissionId":"5ea4f6608c165f702f5bd41e",
"path":[
"/path1",
"/path2"
]
}
```

- input 字段说明

|字段|类型|是否必须|默认值|说明|Description|
|---|---|---|---|---|---|
|permissionId|string|||角色主键id|the permission primary key|
|path|string array||[]|路径列表|the path list|

- output:
```
{
"code":0,
"message":null,
"data":true,
"traceId":""
}
```
- output 字段说明

| 字段|类型|说明|Description|
|---|---|---|---|
|code|bool|错误编码。 0表示success,>0表示失败错误 |0:success, other: failure|
|message|result message|错误消息 |the failure message |
|data | bool | result data |the data for response|
|traceId|string|请求跟踪id|the trace id|


### 更新权限排除路径

- API: PUT /auth/api/permission/excludePath

- API 名称: update_exclude_path
- 功能说明:
- 中文:更新权限排除路径
- English:update permission exclude path

- input body:

``` json
{
"permissionId":"5ea4f6608c165f702f5bd41e",
"path":[
"/path1",
"/path2"
]
}
```

- input 字段说明

|字段|类型|是否必须|默认值|说明|Description|
|---|---|---|---|---|---|
|permissionId|string|||角色主键id|the permission primary key|
|path|string array||[]|路径列表|the path list|

- output:

```
{
"code":0,
"message":null,
"data":true,
"traceId":""
}
```
- output 字段说明

| 字段|类型|说明|Description|
|---|---|---|---|
|code|bool|错误编码。 0表示success,>0表示失败错误 |0:success, other: failure|
|message|result message|错误消息 |the failure message |
|data | bool | result data |the data for response|
|traceId|string|请求跟踪id|the trace id|









|traceId|string|请求跟踪id|the trace id|
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ const val AUTH_API_TOKEN_PREFIX = "api/user/token"
const val AUTH_API_USER_LIST_PREFIX = "api/user/list"
const val AUTH_API_INFO_PREFIX = "api/user/info"
const val AUTH_API_ROLE_SYS_LIST_PREFIX = "api/role/sys/list"
const val AUTH_API_PERMISSION_LIST_PREFIX = "api/permission/list/inproject"
const val AUTH_API_PERMISSION_USER_PREFIX = "api/permission/user"

const val AUTH_API_USER_UPDATE_PREFIX = "api/user/update/info"
const val AUTH_API_USER_DELETE_PREFIX = "api/user/delete"
const val AUTH_API_USER_ASSET_USER_GROUP_PREFIX = "api/user/group"
Expand All @@ -113,6 +112,14 @@ const val AUTH_CLUSTER_PERMISSION_CHECK_PREFIX = "/cluster/permission/check"
const val AUTH_API_EXT_PERMISSION_PREFIX = "/api/ext-permission"
const val AUTH_SERVICE_EXT_PERMISSION_PREFIX = "/service/ext-permission"

const val AUTH_API_PERMISSION_LIST_PREFIX = "/api/permission/list"
const val AUTH_API_PERMISSION_CREATE_PREFIX = "/api/permission/create"
const val AUTH_API_PERMISSION_DELETE_PREFIX = "/api/permission/delete"
const val AUTH_API_PERMISSION_UPDATE_PREFIX = "/api/permission/update/config"

const val AUTH_API_PERMISSION_LIST_IN_PROJECT_PREFIX = "api/permission/list/inproject"
const val AUTH_API_PERMISSION_USER_PREFIX = "api/permission/user"

const val AUTH_ADMIN = "admin"
const val AUTH_BUILTIN_ADMIN = "repo_admin"
const val AUTH_BUILTIN_USER = "repo_user"
Expand Down
Loading

0 comments on commit 7ed2fe8

Please sign in to comment.