Install any skill in seconds. Free to start, no credit card required.
Get Started Free →tencentblueking/前端权限控制方案 (IAM)
基于蓝鲸 IAM 的前端鉴权方案,包含 v-authority 指令实现、权限组件封装及无权限交互规范。
Passed 20 of 25 test cases with the skill, and 7 of 25 without it.
and 15 more in the full report
13 fixed7 passed either way5 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 13 test cases the skill fixed. Same model, same prompt, with and without the skill.
团队代码走查中发现某位同学写出了 `<button v-auth="{ isAllowed: hasPerm, action: 'script_execute' }">执行脚本</button>`。为了符合蓝鲸前端 IAM 指令规范,请指出配置对象属性名需要修正的地方。
| Checked | Without skill | With skill |
|---|---|---|
| Replace isAllowed with permission in the directive parameter object | Missed | Passed |
| Replace action with actionId in the directive parameter object | Passed | Passed |
The instructions your model reads when the skill loads.
在蓝鲸体系中,权限控制不仅仅是“显示/隐藏”,更重要的是**“发现与申请”。我们推荐使用“置灰 + 提示申请”**的交互模式。
v-authority这个指令会自动处理点击拦截、样式置灰和申请弹窗的唤起。
使用方式:
<bk-button v-authority="{ permission: hasAuth, actionId: 'host_edit' }">
编辑
</bk-button>
指令功能:
📦 获取完整指令实现:
skill://permission-directive/assets/authority-directive.ts
AuthButton对于需要更多自定义的场景,可封装鉴权按钮组件。
在 vue-router 的 beforeEach 中处理页面级权限。
router.beforeEach(async (to, from, next) => {
const meta = to.meta as any;
if (meta.auth) {
const hasAuth = await checkPageAuth(meta.authAction);
if (!hasAuth) {
next({ name: '403', query: { action: meta.authAction } });
return;
}
}
next();
test cases passed, vs 7 / 25 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.