मुख्य सामग्री पर जाएँ
Skillpedia
सिक्योरिटी25k · #10092

nocobase-app-plugin-authz-restriction-rules

यह क्या करती है

यह स्किल restriction rules जोड़ती है, जो NocoBase 3 ऐप में किसी action की पहुँच वाले रिकॉर्ड को सीमित करते हैं। यह उन एडमिन के लिए है जिन्हें कुछ रिकॉर्ड कुछ users की पहुँच से बाहर रखने होते हैं।

कब इस्तेमाल करें

  • ✓जब कुछ टीमों को कुछ रिकॉर्ड कभी नहीं देखने चाहिए, जैसे गोपनीय प्रोजेक्ट।
  • ✓जब किसी collection तक हर रास्ते पर एक सीमा लागू होनी चाहिए।
  • ✓जब production में मौजूदा restriction rules जाँचने या संभालने हों।

Skill का लिंक

https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-authz-restriction-rules/skills/nocobase-app-plugin-authz-restriction-rules/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-authz-restriction-rules/skills/nocobase-app-plugin-authz-restriction-rules/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“क्या आप सुनिश्चित कर सकते हैं कि मेरे NocoBase ऐप में engineering टीम गोपनीय प्रोजेक्ट कभी न देख सके?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

AI एक ऐसा नियम बनाता है जो action के पहुँच वाले रिकॉर्ड को, सूचीबद्ध subjects के लिए, अनुमत चयन के साथ मिलाता है। Restriction rules केवल सीमित करते हैं, कभी पहुँच नहीं देते।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Develop restriction rules

A restriction rule intersects the records an action reaches with the rule's selection, for the subjects it lists. The selection describes the records still allowed, not the records to hide. Several matching restrictions all apply; none can grant an action or widen a range.

Read the installed nocobase-app-plugin-authorization Skill first for composite resources, data scopes, fields, server policy enforcement and inherited subjects. The package README at node_modules/@nocobase/app-plugin-authz-restriction-rules/README.md is the complete reference for the service, the HTTP routes and the exports; this Skill covers how to use them.

For a restriction assigned to a department, or to the root department for the whole company, read the application development Skill's references/organization/permission-design.md first. Its core works with permission sets alone and says how to keep excluded records out without this plugin; its optional restriction section covers this one.

Development workflow

  1. State the invariant positively, for example "this team may access only non-confidential projects". Define who it applies to and whether it covers one operation or every path to a collection.
  2. Use a rule on a composite, with scopeKey, for an operation-specific limit. For a limit across every business branch, create a rule on the database.collection with its CRUD actions; declared business data scopes and collection-wide invariants are both provisioned through the HTTP routes or the service.
  3. Register a suitable record access and save the complete rule. Apply the restriction directly to a user as well when it must remain after that person's team membership is removed.
  4. Bind policies on all protected reads and writes. For relation targets, declare relation record access explicitly; a standalone collection restriction is not inherited by nested relation writes.
  5. Verify the excluded row stays inaccessible after adding broad sharing and another permission set, across each protected operation, and that unrelated actors keep their intended access.

For example, a confidentiality restriction assigned directly to each account holds whichever permission set grants the action. Test with ordinary users: unrestricted identities skip every rule.

Install

Register the default export of @nocobase/app-plugin-authz-restriction-rules/client in client/plugins.ts and of @nocobase/app-plugin-authz-restriction-rules/server in server/plugins.ts, beside the main authorization plugin, and run the application's migrations. Add the factory to the plugins of server/config/authorization.ts, merged with the application's other rule factories:

import { restrictionRules } from '@nocobase/app-plugin-authz-restriction-rules/server';
import {
  defineAppConfig,
  type AppConfigFactory,
} from '@nocobase/app-server/config';
import type { AuthorizationConfig } from '@nocobase/app-plugin-authorization/server';

const authorization: AppConfigFactory<AuthorizationConfig> = defineAppConfig(
  () => ({ plugins: [restrictionRules()] }),
);
export default authorization;

During setup the factory registers the settings item authorization.restriction-rules (group authorization, actions read, create, update, delete) and its routes under /api/authorization/restrictionRules, which the running application documents at /api/swagger/docs under the Authorization tag. Without the factory in the configuration the plugin adds no API and no route.

Service API

Resolve authorizationToken from @nocobase/app-plugin-authorization/server in the owning provider or route factory. The rule API exists only when the factory is configured, so narrow the service before using it. quotes is the application's own composite, sales.public its own record access and org.team its own subject type, all defined as the main Skill describes.

import { selection } from '@nocobase/authorization/core';
import {
  defineRestrictionRule,
  type RestrictionRulesAuthorizationApi,
} from '@nocobase/authorization/restriction-rules';
import type { DatabaseConnection } from '@nocobase/db';

if (!('restrictionRules' in authz))
  throw new Error('Restriction rules is not configured');
const rules = (
  authz as typeof authz & RestrictionRulesAuthorizationApi<DatabaseConnection>
).restrictionRules;

await rules.create(
  defineRestrictionRule('public-proposals', quotes.reference())
    .title('Exclude confidential
अक्सर पूछे जाने वाले सवाल

क्या restriction किसी को पहुँच दे सकता है?

नहीं। यह केवल वही सीमित करता है जो पहले से अनुमत है।

क्या कई rules एक साथ लागू होते हैं?

हाँ। मेल खाने वाले सारे restrictions एक ही समय पर लागू होते हैं।

यह default access से कैसे अलग है?

default access एक साझा आधार देता है, जबकि restriction rules यह सीमित करते हैं कि लोग किन रिकॉर्ड तक पहुँच सकें।

जानकारी

लेखक का मूल विवरण

Design, implement and verify restriction rules for NocoBase 3 business operations, including named data scopes and production administration.

repo: nocobase/nocobase

लोकप्रियता

GitHub स्टार
25k
रैंकिंग में स्थान
#10092
लाइसेंस
—
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

nocobase-app-development

25k

यह आपके एजेंट को पूर्ण NocoBase 3 व्यावसायिक एप्लिकेशन के लिए पेज, routes, डेटा, अनुमतियाँ और टेस्ट बनाने में मदद करती है।

कोडिंगसामान्य कोडिंग

shadcn

25k

यह आपके एजेंट को वेब प्रोजेक्ट में shadcn/ui कंपोनेंट खोजने, जोड़ने, ठीक करने और स्टाइल करने में मदद करती है, उनके आधिकारिक दस्तावेज़ और registries का उपयोग करके।

कोडिंगवेबसाइट और UI (frontend)

nocobase-app-plugin-development

25k

यह आपके एजेंट को मौजूदा NocoBase 3 ऐप के भीतर plugins बनाने और उनकी देखभाल करने में मदद करती है, जिसमें server, client, database और registration के हिस्से शामिल हैं।

कोडिंगAPI और सर्वर (backend)

nocobase-app-upgrade

25k

यह आपके एजेंट को NocoBase ऐप को नए template रिलीज़ तक अपग्रेड करने में मदद करती है, template के बदलाव लाते हुए आपका अपना काम बनाए रखते हुए।

कोडिंगडिप्लॉय और क्लाउड (DevOps)

मिलती-जुलती skills