Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@backstage/plugin-permission-node
Advanced tools
Common permission and authorization utilities for backend plugins
@backstage/plugin-permission-node is a plugin for the Backstage platform that provides a framework for managing permissions and access control within a Backstage application. It allows developers to define and enforce permissions for various resources and actions, ensuring that only authorized users can perform certain operations.
Defining Permissions
This feature allows you to define permissions for specific actions or resources. In this example, a 'read' permission is created for a resource type 'example-resource'.
const { createPermission } = require('@backstage/plugin-permission-node');
const readPermission = createPermission({
name: 'read',
attributes: { resourceType: 'example-resource' },
});
Enforcing Permissions
This feature allows you to enforce permissions by checking if a user is authorized to perform a specific action. The 'authorize' function is used to determine if the user has the required permission.
const { authorize } = require('@backstage/plugin-permission-node');
async function checkPermission(user, action) {
const result = await authorize(user, action);
if (result.allowed) {
console.log('Permission granted');
} else {
console.log('Permission denied');
}
}
Permission Policies
This feature allows you to create policies that group multiple permissions together. In this example, an 'admin' policy is created that grants both 'read' and 'write' permissions for the 'example-resource' resource type.
const { createPolicy } = require('@backstage/plugin-permission-node');
const adminPolicy = createPolicy({
name: 'admin',
description: 'Admin policy with full access',
rules: [
{ action: 'read', resourceType: 'example-resource' },
{ action: 'write', resourceType: 'example-resource' },
],
});
Casbin is an authorization library that supports access control models like ACL, RBAC, and ABAC. It provides a flexible and powerful way to manage permissions and access control, similar to @backstage/plugin-permission-node, but with broader support for different access control models.
ACL (Access Control List) is a package for managing user roles and permissions in Node.js applications. It provides a simpler approach to access control compared to @backstage/plugin-permission-node, focusing on role-based access control (RBAC).
Common permission and authorization utilities for backend plugins. For more information, see the permissions documentation on Backstage.io.
FAQs
Common permission and authorization utilities for backend plugins
The npm package @backstage/plugin-permission-node receives a total of 109,715 weekly downloads. As such, @backstage/plugin-permission-node popularity was classified as popular.
We found that @backstage/plugin-permission-node 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.