feat(plugin): 实体级 data_scope + scope_role + data_scope_levels 声明

- PluginEntity 新增 data_scope: Option<bool> 字段,控制是否启用行级数据权限
- PluginField 新增 scope_role: Option<String> 字段,标记数据权限的"所有者"字段
- PluginPermission 新增 data_scope_levels: Option<Vec<String>> 字段,声明支持的数据范围等级
- 更新 default_for_field() 测试辅助和 dynamic_table.rs 中的 PluginEntity 构造
- 新增 parse_entity_with_data_scope 和 parse_permission_with_data_scope_levels 测试
This commit is contained in:
iven
2026-04-17 10:45:49 +08:00
parent 89684313d9
commit 41a0dc8bd6
2 changed files with 53 additions and 0 deletions

View File

@@ -1019,6 +1019,7 @@ mod tests {
],
indexes: vec![],
relations: vec![],
data_scope: None,
};
let sql = DynamicTableManager::build_create_table_sql("erp_crm", &entity);
@@ -1060,6 +1061,7 @@ mod tests {
}],
indexes: vec![],
relations: vec![],
data_scope: None,
};
let sql = DynamicTableManager::build_create_table_sql("erp_crm", &entity);