
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
const rbac = new RBAC(roles, options);
// 访问路由时检查权限
// allow: result = null
// deny: result = [deny reason]
const result = rbac.check({
roles: 'admin' // roleId or array of roleId,
target: 'get /admin', // route
});
// 更新数据时检查权限
// allow: result = null
// deny: result = [deny reason]
const result = rbac.check({
roles: 'admin' // roleId or array of roleId,
target: 'team', // model name
source: { // data to update
balance: 999,
}
});
name | merge | weight |
---|---|---|
admin | force | 1 |
banned | force | 2 |
free | merge | 999999 |
vip | merge | 10 |
alpha | merge | 0 |
role | target | action |
---|---|---|
admin | team.balance | 3 |
guest | get / | 1 |
guest | get /desktop | 0 |
free | get /desktop | 1 |
free | get /vip_feature | 0 |
vip | get /vip_feature | 1 |
alpha | get /alpha_feature | 1 |
列表中的权限默认为禁止 普通用户 free 付费用户 free vip 合并 禁止用户
FAQs
role base access control
We found that shimo-rbac demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.