@lark-apaas/coding-miaoda-sandbox-skills 0.1.34 → 0.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/miaoda/authz-cli/SKILL.md +13 -13
- package/miaoda/lark-apps-authz/SKILL.md +18 -12
- package/package.json +1 -1
|
@@ -217,17 +217,17 @@ CREATE TABLE IF NOT EXISTS authz_role_permissions (
|
|
|
217
217
|
|
|
218
218
|
```sql
|
|
219
219
|
-- 按「权限点位定义」表
|
|
220
|
-
INSERT INTO authz_permissions (action, subject, description) VALUES
|
|
221
|
-
('read', 'Task', '查看任务'),
|
|
222
|
-
('create', 'Task', '创建任务'),
|
|
223
|
-
('update', 'Task', '编辑任务'),
|
|
224
|
-
('delete', 'Task', '删除任务');
|
|
220
|
+
INSERT INTO authz_permissions (action, subject, description, creator) VALUES
|
|
221
|
+
('read', 'Task', '查看任务', ROW('<当前妙搭 user_id>')::user_profile),
|
|
222
|
+
('create', 'Task', '创建任务', ROW('<当前妙搭 user_id>')::user_profile),
|
|
223
|
+
('update', 'Task', '编辑任务', ROW('<当前妙搭 user_id>')::user_profile),
|
|
224
|
+
('delete', 'Task', '删除任务', ROW('<当前妙搭 user_id>')::user_profile);
|
|
225
225
|
|
|
226
226
|
-- 按「角色-点位初始映射」表
|
|
227
|
-
INSERT INTO authz_role_permissions (role_key, permission_id) VALUES
|
|
228
|
-
('admin', (SELECT id FROM authz_permissions WHERE action='read' AND subject='Task')),
|
|
229
|
-
('admin', (SELECT id FROM authz_permissions WHERE action='create' AND subject='Task')),
|
|
230
|
-
('member', (SELECT id FROM authz_permissions WHERE action='read' AND subject='Task'));
|
|
227
|
+
INSERT INTO authz_role_permissions (role_key, permission_id, creator) VALUES
|
|
228
|
+
('admin', (SELECT id FROM authz_permissions WHERE action='read' AND subject='Task'), ROW('<当前妙搭 user_id>')::user_profile),
|
|
229
|
+
('admin', (SELECT id FROM authz_permissions WHERE action='create' AND subject='Task'), ROW('<当前妙搭 user_id>')::user_profile),
|
|
230
|
+
('member', (SELECT id FROM authz_permissions WHERE action='read' AND subject='Task'), ROW('<当前妙搭 user_id>')::user_profile);
|
|
231
231
|
```
|
|
232
232
|
|
|
233
233
|
> 以上 SQL 仅为示例,实际数据根据权限设计方案生成。
|
|
@@ -238,12 +238,12 @@ INSERT INTO authz_role_permissions (role_key, permission_id) VALUES
|
|
|
238
238
|
|
|
239
239
|
```sql
|
|
240
240
|
-- 1. 新增点位定义(authz_permissions 表)
|
|
241
|
-
INSERT INTO authz_permissions (action, subject, description) VALUES
|
|
242
|
-
('export', 'Task', '导出任务');
|
|
241
|
+
INSERT INTO authz_permissions (action, subject, description, creator) VALUES
|
|
242
|
+
('export', 'Task', '导出任务', ROW('<当前妙搭 user_id>')::user_profile);
|
|
243
243
|
|
|
244
244
|
-- 2. 为需要该权限的角色添加映射(authz_role_permissions 表)
|
|
245
|
-
INSERT INTO authz_role_permissions (role_key, permission_id) VALUES
|
|
246
|
-
('admin', (SELECT id FROM authz_permissions WHERE action='export' AND subject='Task'));
|
|
245
|
+
INSERT INTO authz_role_permissions (role_key, permission_id, creator) VALUES
|
|
246
|
+
('admin', (SELECT id FROM authz_permissions WHERE action='export' AND subject='Task'), ROW('<当前妙搭 user_id>')::user_profile);
|
|
247
247
|
```
|
|
248
248
|
|
|
249
249
|
> **必须同步**:
|
|
@@ -218,18 +218,24 @@ lark-cli apps +role-member-remove --app-id "$app_id" --role-id <role_id> --all -
|
|
|
218
218
|
按权限设计方案的「权限点位定义」和「角色-点位初始映射」表预填:
|
|
219
219
|
|
|
220
220
|
```sql
|
|
221
|
-
--
|
|
222
|
-
INSERT INTO authz_permissions (action, subject, description)
|
|
221
|
+
-- 权限点位
|
|
222
|
+
INSERT INTO authz_permissions (action, subject, description, creator)
|
|
223
|
+
SELECT action, subject, description, ROW('<当前妙搭 user_id>')::user_profile
|
|
224
|
+
FROM (VALUES
|
|
223
225
|
('read', 'Task', '查看任务'),
|
|
224
226
|
('create', 'Task', '创建任务'),
|
|
225
227
|
('update', 'Task', '编辑任务'),
|
|
226
|
-
('delete', 'Task', '删除任务')
|
|
228
|
+
('delete', 'Task', '删除任务')
|
|
229
|
+
) AS v(action, subject, description);
|
|
227
230
|
|
|
228
|
-
--
|
|
229
|
-
INSERT INTO authz_role_permissions (role_key, permission_id)
|
|
231
|
+
-- 角色-点位映射
|
|
232
|
+
INSERT INTO authz_role_permissions (role_key, permission_id, creator)
|
|
233
|
+
SELECT role_key, permission_id, ROW('<当前妙搭 user_id>')::user_profile
|
|
234
|
+
FROM (VALUES
|
|
230
235
|
('admin', (SELECT id FROM authz_permissions WHERE action='read' AND subject='Task')),
|
|
231
236
|
('admin', (SELECT id FROM authz_permissions WHERE action='create' AND subject='Task')),
|
|
232
|
-
('member', (SELECT id FROM authz_permissions WHERE action='read' AND subject='Task'))
|
|
237
|
+
('member', (SELECT id FROM authz_permissions WHERE action='read' AND subject='Task'))
|
|
238
|
+
) AS v(role_key, permission_id);
|
|
233
239
|
```
|
|
234
240
|
|
|
235
241
|
> 以上 SQL 仅为示例,实际数据根据权限设计方案生成。
|
|
@@ -239,13 +245,13 @@ INSERT INTO authz_role_permissions (role_key, permission_id) VALUES
|
|
|
239
245
|
新功能上线时,新增点位 + 初始映射 + 同步鉴权代码:
|
|
240
246
|
|
|
241
247
|
```sql
|
|
242
|
-
--
|
|
243
|
-
INSERT INTO authz_permissions (action, subject, description) VALUES
|
|
244
|
-
('export', 'Task', '导出任务');
|
|
248
|
+
-- 新增权限点位
|
|
249
|
+
INSERT INTO authz_permissions (action, subject, description, creator) VALUES
|
|
250
|
+
('export', 'Task', '导出任务', ROW('<当前妙搭 user_id>')::user_profile);
|
|
245
251
|
|
|
246
|
-
--
|
|
247
|
-
INSERT INTO authz_role_permissions (role_key, permission_id) VALUES
|
|
248
|
-
('admin', (SELECT id FROM authz_permissions WHERE action='export' AND subject='Task'));
|
|
252
|
+
-- 新增角色-点位映射
|
|
253
|
+
INSERT INTO authz_role_permissions (role_key, permission_id, creator) VALUES
|
|
254
|
+
('admin', (SELECT id FROM authz_permissions WHERE action='export' AND subject='Task'), ROW('<当前妙搭 user_id>')::user_profile);
|
|
249
255
|
```
|
|
250
256
|
|
|
251
257
|
> **必须同步**:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/coding-miaoda-sandbox-skills",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.35",
|
|
4
4
|
"description": "Miaoda 合并沙箱 skills 包(包含原 miaoda-skills 的 miaoda / miaoda-modern / miaoda-design / shared 四条业务线);发布公网 npm,随沙箱运行时经 update-skills 同步到 .agent/skills/",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|