You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/10/18 18:53:32 UTC

[GitHub] [apisix] leslie-tsang commented on a change in pull request #5274: docs: add simplified Chinese translation for plugin authz-casbin

leslie-tsang commented on a change in pull request #5274:
URL: https://github.com/apache/apisix/pull/5274#discussion_r731205572



##########
File path: docs/zh/latest/plugins/authz-casbin.md
##########
@@ -0,0 +1,249 @@
+---
+title: authz-casbin
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## 目录
+
+- [**简介**](#简介)
+- [**属性**](#属性)
+- [**元数据**](#元数据)
+- [**如何启用**](#如何启用)
+- [**测试插件**](#测试插件)
+- [**禁用插件**](#禁用插件)
+- [**示例**](#示例)
+
+## 简介
+
+`authz-casbin` 是一个基于 [Lua Casbin](https://github.com/casbin/lua-casbin/) 的访问控制插件. 该插件支持基于各种访问控制模型的授权场景。

Review comment:
       ```suggestion
   `authz-casbin` 是一个基于 [Lua Casbin](https://github.com/casbin/lua-casbin/) 的访问控制插件,该插件支持基于各种访问控制模型的授权场景。
   ```

##########
File path: docs/zh/latest/plugins/authz-casbin.md
##########
@@ -0,0 +1,249 @@
+---
+title: authz-casbin
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## 目录
+
+- [**简介**](#简介)
+- [**属性**](#属性)
+- [**元数据**](#元数据)
+- [**如何启用**](#如何启用)
+- [**测试插件**](#测试插件)
+- [**禁用插件**](#禁用插件)
+- [**示例**](#示例)
+
+## 简介
+
+`authz-casbin` 是一个基于 [Lua Casbin](https://github.com/casbin/lua-casbin/) 的访问控制插件. 该插件支持基于各种访问控制模型的授权场景。
+
+有关如何创建模型和策略的详细文档, 请参阅 [Casbin](https://casbin.org/docs/en/supported-models)。
+
+## 属性
+
+| 名称        | 类型   | 必选项| 默认值 | 有效值 | 描述                                     |
+| ----------- | ------ | ----------- | ------- | ----- | ----------------------------- |
+| model_path  | string | 必须    |         |       | Casbin 模型配置文件路径。             |
+| policy_path | string | 必须    |         |       | Casbin 策略配置文件路径。             |
+| model       | string | 必须    |         |       | 描述 Casbin 的模型定义。              |
+| policy      | string | 必须    |         |       | 描述 Casbin 的策略定义。              |
+| username    | string | 必须    |         |       | 描述请求中有可以通过访问控制的用户名The。 |

Review comment:
       ```suggestion
   | 名称        | 类型   | 必选项| 默认值 | 有效值 | 描述                                     |
   | ----------- | ------ | ----------- | ------- | ----- | ----------------------------- |
   | model_path  | string | 必须    |         |       | Casbin 模型配置文件路径             |
   | policy_path | string | 必须    |         |       | Casbin 策略配置文件路径             |
   | model       | string | 必须    |         |       | 描述 Casbin 的模型定义              |
   | policy      | string | 必须    |         |       | 描述 Casbin 的策略定义              |
   | username    | string | 必须    |         |       | 描述请求中有可以通过访问控制的用户名 |
   ```

##########
File path: docs/zh/latest/plugins/authz-casbin.md
##########
@@ -0,0 +1,249 @@
+---
+title: authz-casbin
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## 目录
+
+- [**简介**](#简介)
+- [**属性**](#属性)
+- [**元数据**](#元数据)
+- [**如何启用**](#如何启用)
+- [**测试插件**](#测试插件)
+- [**禁用插件**](#禁用插件)
+- [**示例**](#示例)
+
+## 简介
+
+`authz-casbin` 是一个基于 [Lua Casbin](https://github.com/casbin/lua-casbin/) 的访问控制插件. 该插件支持基于各种访问控制模型的授权场景。
+
+有关如何创建模型和策略的详细文档, 请参阅 [Casbin](https://casbin.org/docs/en/supported-models)。
+
+## 属性
+
+| 名称        | 类型   | 必选项| 默认值 | 有效值 | 描述                                     |
+| ----------- | ------ | ----------- | ------- | ----- | ----------------------------- |
+| model_path  | string | 必须    |         |       | Casbin 模型配置文件路径。             |
+| policy_path | string | 必须    |         |       | Casbin 策略配置文件路径。             |
+| model       | string | 必须    |         |       | 描述 Casbin 的模型定义。              |
+| policy      | string | 必须    |         |       | 描述 Casbin 的策略定义。              |
+| username    | string | 必须    |         |       | 描述请求中有可以通过访问控制的用户名The。 |
+
+**注意**: 在插件配置中指定 `model_path`、`policy_path` 和 `username`,或者在插件配置中指定 `model`、 `policy` 和 `username` 来使插件生效。如果你想使用全局的 Casbin 配置,可以先在插件元数据中指定模型和策略,然后插件配置中指定 `username`。通过这种方式可以使所有的路由共享一个配置。
+
+## 元数据
+
+| 名称        | 类型   | 必选项 | 默认值 | 有效值 | 描述                            |
+| ----------- | ------ | ----------- | ------- | -----                         | ----------------------------------------------------------------------         |
+| model       | string | 必须    |         |       | 描述 Casbin 的模型定义。     |
+| policy      | string | 必须    |         |       | 描述 Casbin 的策略定义。     |

Review comment:
       ```suggestion
   | 名称        | 类型   | 必选项 | 默认值 | 有效值 | 描述                            |
   | ----------- | ------ | ----------- | ------- | -----                         | ----------------------------------------------------------------------         |
   | model       | string | 必须    |         |       | 描述 Casbin 的模型定义     |
   | policy      | string | 必须    |         |       | 描述 Casbin 的策略定义     |
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org