![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@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 72,863 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.