feat: add alias policy introduction

Add alias policy introduction to document

Change-Id: I1e0ee2026173c6d6b588adea74ed8823a37eac7b
This commit is contained in:
xusongfu 2022-06-30 16:27:21 +08:00
parent 41eaf509b6
commit eb29f25a47
12 changed files with 130 additions and 12 deletions

View File

@ -70,7 +70,7 @@ English | [Chinese](../../zh/develop/3-1-BaseList-introduction.md)
## Properties and functions that usually need to be overridden
- `policy`:
- The function must be overridden
- The function must be overridden (Fill in the policy that complies with the openstack rules here)
- The permission corresponding to the page, if the permission verification fails, data cannot be requested.
- Take the volume `src/pages/storage/containers/Volume/index.jsx` as an example
@ -80,6 +80,17 @@ English | [Chinese](../../zh/develop/3-1-BaseList-introduction.md)
}
```
- `aliasPolicy`:
- The function can be overridden (Fill in the custom policy with module prefix here)
- The permission corresponding to the page, if the permission verification fails, data cannot be requested.
- Take the volume `src/pages/storage/containers/Volume/index.jsx` as an example
```javascript
get aliasPolicy() {
return 'cinder:volume:get_all';
}
```
- `name`
- The function must be overridden
- The name corresponding to the page resource.

View File

@ -45,7 +45,7 @@ English | [Chinese](../../zh/develop/3-3-BaseDetail-introduction.md)
## Properties and functions that usually need to be overridden
- `policy`:
- The function must be overridden
- The function must be overridden (Fill in the policy that complies with the openstack rules here)
- The permission corresponding to the page, if the permission verification fails, data cannot be requested.
- Take the volume `src/pages/storage/containers/Volume/Detail/index.jsx` as an example
@ -55,6 +55,17 @@ English | [Chinese](../../zh/develop/3-3-BaseDetail-introduction.md)
}
```
- `aliasPolicy`:
- The function can be overridden (Fill in the custom policy with module prefix here)
- The permission corresponding to the page, if the permission verification fails, data cannot be requested.
- Take the volume `src/pages/storage/containers/Volume/Detail/index.jsx` as an example
```javascript
get aliasPolicy() {
return 'cinder:volume:get';
}
```
- `name`
- The function must be overridden
- The name corresponding to the page resource.

View File

@ -92,7 +92,7 @@ English | [Chinese](../../zh/develop/3-6-FormAction-introduction.md)
```
- `policy`
- Static properties
- Static properties (Fill in the policy that complies with the openstack rules here)
- The permission corresponding to the page. If the permission verification fails, the operation button will not be displayed on the resource list page
- Take the volume `src/pages/storage/containers/Volume/actions/Create/index.jsx` as an example
@ -100,6 +100,15 @@ English | [Chinese](../../zh/develop/3-6-FormAction-introduction.md)
static policy = 'volume:create';
```
- `aliasPolicy`
- Static properties (Fill in the custom policy with module prefix here)
- The permission corresponding to the page. If the permission verification fails, the operation button will not be displayed on the resource list page
- Take the volume `src/pages/storage/containers/Volume/actions/Create/index.jsx` as an example
```javascript
static aliasPolicy = 'cinder:volume:create';
```
- `allowed`
- Static functions
- Determine whether the operation needs to be disabled

View File

@ -79,7 +79,7 @@ English | [简体中文](../../zh/develop/3-7-ModalAction-introduction.md)
```
- `policy`
- Static
- Static (Fill in the policy that complies with the openstack rules here)
- Action permission, if the permission verify failed, the action button will not be displayed on the resource list page
- Take attach volume as an example `src/pages/compute/containers/Instance/actions/AttachVolume.jsx` :
@ -87,6 +87,15 @@ English | [简体中文](../../zh/develop/3-7-ModalAction-introduction.md)
static policy = 'os_compute_api:os-volumes-attachments:create';
```
- `aliasPolicy`
- Static (Fill in the custom policy with module prefix here)
- Action permission, if the permission verify failed, the action button will not be displayed on the resource list page
- Take attach volume as an example `src/pages/compute/containers/Instance/actions/AttachVolume.jsx` :
```javascript
static aliasPolicy = 'nova:os_compute_api:os-volumes-attachments:create';
```
- `allowed`
- Static
- Determine whether the action button needs to be disabled

View File

@ -78,13 +78,21 @@ English | [简体中文](../../zh/develop/3-8-ConfirmAction-introduction.md)
```
- `policy`
- Action permission, if the permission verify failed, the action button will not be displayed on the resource list page.
- Action permission, if the permission verify failed, the action button will not be displayed on the resource list page. (Fill in the policy that complies with the openstack rules here)
- Take stop instance as an example `src/pages/compute/containers/Instance/actions/Stop.jsx` :
```javascript
policy = 'os_compute_api:servers:stop';
```
- `aliasPolicy`
- Action permission, if the permission verify failed, the action button will not be displayed on the resource list page. (Fill in the custom policy with module prefix here)
- Take stop instance as an example `src/pages/compute/containers/Instance/actions/Stop.jsx` :
```javascript
aliasPolicy = 'nova:os_compute_api:servers:stop';
```
- `allowedCheckFunc`
- Determine whether the action button needs to be disabled
- Return `Boolean`

View File

@ -100,7 +100,7 @@ English | [简体中文](../../zh/develop/3-9-StepAction-introduction.md)
```
- `policy`
- Static attribute
- Static attribute (Fill in the policy that complies with the openstack rules here)
- The permission corresponding to the page, if the permission verification fails, the action button will not be displayed on the resource list page
- Take create instance as an example `src/pages/compute/containers/Instance/actions/StepCreate/index.jsx` :
@ -111,6 +111,18 @@ English | [简体中文](../../zh/develop/3-9-StepAction-introduction.md)
];
```
- `aliasPolicy`
- Static attribute (Fill in the custom policy with module prefix here)
- The permission corresponding to the page, if the permission verification fails, the action button will not be displayed on the resource list page
- Take create instance as an example `src/pages/compute/containers/Instance/actions/StepCreate/index.jsx` :
```javascript
static aliasPolicy = [
'nova:os_compute_api:servers:create',
'nova:os_compute_api:os-availability-zone:list',
];
```
- `allowed`
- Static
- Determine whether the action button needs to be disabled

View File

@ -70,7 +70,7 @@
## 通常需要复写的属性与函数
- `policy`:
- 必须复写该函数
- 必须复写该函数 (此处填写符合openstack规范的policy)
- 页面对应的权限,如果权限验证不通过,则无法请求数据。
- 以云硬盘`src/pages/storage/containers/Volume/index.jsx`为例
@ -80,6 +80,17 @@
}
```
- `aliasPolicy`:
- 可以复写该函数 (此处填写带模块前缀的自定义policy)
- 页面对应的权限,如果权限验证不通过,则无法请求数据。
- 以云硬盘`src/pages/storage/containers/Volume/index.jsx`为例
```javascript
get aliasPolicy() {
return 'cinder:volume:get_all';
}
```
- `name`
- 必须复写该函数
- 页面资源对应的名称。

View File

@ -45,7 +45,7 @@
## 通常需要复写的属性与函数
- `policy`:
- 必须复写该函数
- 必须复写该函数 (此处填写符合openstack规范的policy)
- 页面对应的权限,如果权限验证不通过,则无法请求数据。
- 以云硬盘`src/pages/storage/containers/Volume/Detail/index.jsx`为例
@ -55,6 +55,17 @@
}
```
- `aliasPolicy`:
- 可以复写该函数 (此处填写带模块前缀的自定义policy)
- 页面对应的权限,如果权限验证不通过,则无法请求数据。
- 以云硬盘`src/pages/storage/containers/Volume/Detail/index.jsx`为例
```javascript
get aliasPolicy() {
return 'cinder:volume:get';
}
```
- `name`
- 必须复写该函数
- 页面资源对应的名称。

View File

@ -92,7 +92,7 @@
```
- `policy`
- 静态属性
- 静态属性 (此处填写符合openstack规范的policy)
- 页面对应的权限,如果权限验证不通过,则不会在资源列表页面显示该操作按钮
- 以云硬盘`src/pages/storage/containers/Volume/actions/Create/index.jsx`为例
@ -100,6 +100,15 @@
static policy = 'volume:create';
```
- `aliasPolicy`
- 静态属性 (此处填写带模块前缀的自定义policy)
- 页面对应的权限,如果权限验证不通过,则不会在资源列表页面显示该操作按钮
- 以云硬盘`src/pages/storage/containers/Volume/actions/Create/index.jsx`为例
```javascript
static aliasPolicy = 'cinder:volume:create';
```
- `allowed`
- 静态函数
- 判定操作是否需要被禁用

View File

@ -79,7 +79,7 @@
```
- `policy`
- 静态属性
- 静态属性 (此处填写符合openstack规范的policy)
- 操作对应的权限,如果权限验证不通过,则不会在资源列表页面显示该操作按钮
- 以挂载云硬盘`src/pages/compute/containers/Instance/actions/AttachVolume.jsx`为例
@ -87,6 +87,15 @@
static policy = 'os_compute_api:os-volumes-attachments:create';
```
- `aliasPolicy`
- 静态属性 (此处填写带模块前缀的自定义policy)
- 操作对应的权限,如果权限验证不通过,则不会在资源列表页面显示该操作按钮
- 以挂载云硬盘`src/pages/compute/containers/Instance/actions/AttachVolume.jsx`为例
```javascript
static aliasPolicy = 'nova:os_compute_api:os-volumes-attachments:create';
```
- `allowed`
- 静态函数
- 判定操作是否需要被禁用

View File

@ -78,12 +78,19 @@
```
- `policy`
- 页面对应的权限,如果权限验证不通过,则不会在资源列表页面显示该操作按钮
- 页面对应的权限,如果权限验证不通过,则不会在资源列表页面显示该操作按钮 (此处填写符合openstack规范的policy)
- 以停止云主机`src/pages/compute/containers/Instance/actions/Stop.jsx`为例
```javascript
policy = 'os_compute_api:servers:stop';
```
- `aliasPolicy`
- 页面对应的权限,如果权限验证不通过,则不会在资源列表页面显示该操作按钮 (此处填写带模块前缀的自定义policy)
- 以停止云主机`src/pages/compute/containers/Instance/actions/Stop.jsx`为例
```javascript
aliasPolicy = 'nova:os_compute_api:servers:stop';
```
- `allowedCheckFunc`
- 判定操作是否需要被禁用

View File

@ -100,7 +100,7 @@
```
- `policy`
- 静态属性
- 静态属性 (此处填写符合openstack规范的policy)
- 页面对应的权限,如果权限验证不通过,则不会在资源列表页面显示该操作按钮
- 以创建云主机`src/pages/compute/containers/Instance/actions/StepCreate/index.jsx`为例
@ -110,6 +110,17 @@
'os_compute_api:os-availability-zone:list',
];
```
- `aliasPolicy`
- 静态属性 (此处填写带模块前缀的自定义policy)
- 页面对应的权限,如果权限验证不通过,则不会在资源列表页面显示该操作按钮
- 以创建云主机`src/pages/compute/containers/Instance/actions/StepCreate/index.jsx`为例
```javascript
static aliasPolicy = [
'nova:os_compute_api:servers:create',
'nova:os_compute_api:os-availability-zone:list',
];
```
- `allowed`
- 静态函数