nocobase-app-plugin-authz-sharing-rules
यह क्या करती है
यह स्किल NocoBase 3 के business actions के लिए sharing rules कॉन्फ़िगर करती है। यह उन एडमिन के लिए है जिन्हें किसी सहयोग के लिए कुछ खास रिकॉर्ड दूसरों के साथ साझा करने होते हैं।
कब इस्तेमाल करें
- ✓जब एक व्यक्ति को कुछ खास रिकॉर्ड दूसरे व्यक्ति या विभाग के साथ साझा करने हों।
- ✓जब किसी विभाग को किसी खास काम के लिए दूसरे विभाग के रिकॉर्ड चाहिए हों।
- ✓जब production में sharing rules जाँचने या संभालने हों।
Skill का लिंक
https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-authz-sharing-rules/skills/nocobase-app-plugin-authz-sharing-rules/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप finance टीम को उनकी सामान्य पहुँच के अलावा ये तीन प्रोजेक्ट देखने की अनुमति दे सकते हैं?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
AI एक sharing rule बनाता है, जो सूचीबद्ध लोगों या विभागों के लिए चुने हुए रिकॉर्ड जोड़ता है। यह नियम केवल उन्हीं लोगों पर लागू होता है जिनके पास action पहले से है, और यह सारे रिकॉर्ड नहीं चुन सकता।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Develop sharing rules
A sharing rule adds selected records, or a record access selection, for the subjects it lists, provided they already hold the action. Sharing does not grant the operation, fields, page access or related records, and it cannot select all records. Grants, default access and sharing combine first; restriction rules then narrow the result.
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-sharing-rules/README.md is the complete reference for the service, the HTTP routes and the exports; this Skill covers how to use them.
For sharing between departments, read the application development Skill's references/organization/permission-design.md first. A rule whose recipient is a department shares specific records with it; a viewer-relative department scope such as 本部门及下属部门 is computed for the viewer and cannot select another department's records. The guide's optional sharing section covers this plugin, and its core section says what remains with permission sets alone.
Development workflow
- Identify the real collaboration exception: who receives which records, for which actions, and why. Use explicit records for one handover; use a record access selection for a maintained region or team rule.
- Grant the recipients the business action through a permission set first. Register inherited subjects and their active membership resolver through the main authorization Skill.
- Inspect every data scope the operation requires. Quote submission needs the selected quote and its actual parent project. Add each action and data scope deliberately; view, edit and submit are different permissions.
- Save a complete rule through the HTTP routes or the service. Keep record ids tied to their data scope's collection and preserve the other entries on update.
- Verify the handover works, an unshared parent still blocks the workflow, restrictions still exclude confidential records, and sharing alone cannot activate a missing operation.
- Revoke the recipient or the team's permission set and verify the next request loses only that source. Independent direct-user sharing and direct assignments must survive.
For example, a quote handover shares quote edit and submit plus the parent project's submit scope with a delegated engineer. Use the real record ids, never sample ones.
Install
Register the default export of @nocobase/app-plugin-authz-sharing-rules/client in client/plugins.ts and of @nocobase/app-plugin-authz-sharing-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 { sharingRules } from '@nocobase/app-plugin-authz-sharing-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: [sharingRules()] }),
);
export default authorization;
During setup the factory registers the settings item authorization.sharing-rules (group authorization, actions read, create, update, delete) and its routes under /api/authorization/sharingRules, 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 and org.team its own subject type, both defined as the main Skill describes.
import { selection } from '@nocobase/authorization/core';
import {
defineSharingRule,
type SharingRulesAuthorizationApi,
} from '@nocobase/authorization/sharing-rules';
import type { DatabaseConnection } from '@nocobase/db';
if (!('sharingRules' in authz))
throw new Error('Sharing rules is not configured');
const rules = (
authz as typeof authz & SharingRulesAuthorizationApi<DatabaseConnection>
).sharingRules;
await rules.create(
अक्सर पूछे जाने वाले सवाल
क्या sharing से नई अनुमतियाँ मिलती हैं?
नहीं। sharing केवल उन लोगों के लिए रिकॉर्ड जोड़ती है जिनके पास action पहले से है।
क्या मैं सारे रिकॉर्ड एक साथ साझा कर सकता हूँ?
नहीं। sharing सारे रिकॉर्ड नहीं चुन सकती।
restriction rules के साथ यह कैसे काम करता है?
restriction rules बाद में भी लागू होते हैं और परिणाम को सीमित कर सकते हैं।
जानकारी
लेखक का मूल विवरण
Design, implement and verify sharing rules for NocoBase 3 business operations, including named data scopes and production administration.
repo: nocobase/nocobase
लोकप्रियता
- GitHub स्टार
- 25k
- रैंकिंग में स्थान
- #10093
- लाइसेंस
- —
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
nocobase-app-development
25kयह आपके एजेंट को पूर्ण NocoBase 3 व्यावसायिक एप्लिकेशन के लिए पेज, routes, डेटा, अनुमतियाँ और टेस्ट बनाने में मदद करती है।
shadcn
25kयह आपके एजेंट को वेब प्रोजेक्ट में shadcn/ui कंपोनेंट खोजने, जोड़ने, ठीक करने और स्टाइल करने में मदद करती है, उनके आधिकारिक दस्तावेज़ और registries का उपयोग करके।
nocobase-app-plugin-development
25kयह आपके एजेंट को मौजूदा NocoBase 3 ऐप के भीतर plugins बनाने और उनकी देखभाल करने में मदद करती है, जिसमें server, client, database और registration के हिस्से शामिल हैं।
nocobase-app-upgrade
25kयह आपके एजेंट को NocoBase ऐप को नए template रिलीज़ तक अपग्रेड करने में मदद करती है, template के बदलाव लाते हुए आपका अपना काम बनाए रखते हुए।
मिलती-जुलती skills
reverse-engineer-anything
422kयह आपके एजेंट को REA टूल से शिप हुई ऐप्स और पैकेज को अंदर से समझने, वर्ज़न की तुलना करने या दोबारा बनाने में मदद करती है।
1password
394kयह आपके एजेंट को 1Password CLI सेट करने, साइन इन करने और सीक्रेट्स की वैल्यू चैट में छापे बिना उन्हें पढ़ने या इस्तेमाल करने में मदद करती है।
healthcheck
394kयह आपके एजेंट को उस कंप्यूटर या सर्वर का सुरक्षा ऑडिट करने देती है जिस पर OpenClaw चलता है, जिसमें SSH, firewall, अपडेट और बैकअप शामिल हैं, और फिर सुरक्षित सुधार सुझाती है।