
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@backstage/plugin-permission-common
Advanced tools
Isomorphic types and client for Backstage permissions and authorization
@backstage/plugin-permission-common is a package that provides common types and utilities for implementing permission-based access control in Backstage plugins. It helps in defining and managing permissions, rules, and policies to control access to various resources within a Backstage application.
Defining Permissions
This feature allows you to define custom permissions for your Backstage plugins. The `createPermission` function is used to create a new permission with a specified name and attributes.
const { createPermission } = require('@backstage/plugin-permission-common');
const myPermission = createPermission({
name: 'my-plugin.my-permission',
attributes: { action: 'read' },
});
Creating Permission Rules
This feature allows you to create rules that determine whether a user has a specific permission. The `createPermissionRule` function is used to define a rule with a name, description, and an apply function that contains the logic for the rule.
const { createPermissionRule } = require('@backstage/plugin-permission-common');
const isUserAdmin = createPermissionRule({
name: 'is-user-admin',
description: 'Checks if the user is an admin',
apply: (resource, user) => user.isAdmin,
});
Evaluating Permissions
This feature allows you to evaluate whether a user has a specific permission for a given resource. The `evaluatePermission` function takes a permission, user, and resource as arguments and returns the evaluation result.
const { evaluatePermission } = require('@backstage/plugin-permission-common');
const result = evaluatePermission(myPermission, user, resource);
console.log(result);
Casbin is a powerful and efficient open-source access control library that supports various access control models like ACL, RBAC, and ABAC. It provides a flexible way to define permissions and policies, similar to @backstage/plugin-permission-common, but is more general-purpose and can be used outside of Backstage.
AccessControl is a Node.js module that provides Role-Based Access Control (RBAC) for your application. It allows you to define roles and permissions in a flexible way. While it focuses on RBAC, it offers similar functionality to @backstage/plugin-permission-common in terms of defining and managing permissions.
Isomorphic types and client for Backstage permissions and authorization. For more information, see the permissions documentation on Backstage.io.
FAQs
Isomorphic types and client for Backstage permissions and authorization
The npm package @backstage/plugin-permission-common receives a total of 203,899 weekly downloads. As such, @backstage/plugin-permission-common popularity was classified as popular.
We found that @backstage/plugin-permission-common demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.