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

nocobase-app-plugin-authz-default-access

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

यह स्किल NocoBase 3 के business actions के लिए डिफ़ॉल्ट पहुँच कॉन्फ़िगर करती है, जिससे रिकॉर्ड का एक साझा आधार मिलता है। यह उन एडमिन और डेवलपर्स के लिए है जो रिकॉर्ड की दृश्यता संभालते हैं।

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

  • ✓जब किसी action वाले सभी लोगों को डिफ़ॉल्ट रूप से रिकॉर्ड का एक साझा सेट दिखना चाहिए।
  • ✓जब आप चाहें कि पूरा विभाग रिकॉर्ड पढ़ सके, लेकिन उन्हें बदल न सके।
  • ✓जब आपको production में डिफ़ॉल्ट पहुँच जाँचनी या संभालनी हो।

Skill का लिंक

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

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

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

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

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

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

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

“क्या आप हर sales user को सारे खुले leads पढ़ने की डिफ़ॉल्ट अनुमति दे सकते हैं, जबकि edit करने की अनुमति केवल मालिक तक सीमित रहे?”

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

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

AI एक action के लिए डिफ़ॉल्ट data scope सेट करता है। वह action खुद नहीं देता, और दूसरे नियम परिणामों को फिर भी सीमित करते हैं।

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

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

Develop default access

Default access adds a shared record baseline for every identity that already holds an action. It does not grant the action, page access or additional fields. A baseline combines with permission-set data scopes and sharing, and restriction rules still narrow the result, so choose it as an intentional minimum range rather than a fallback for identities without a scope of their own.

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-default-access/README.md is the complete reference for the service, the HTTP routes and the exports; this Skill covers how to use them.

For a department-scoped baseline, read the application development Skill's references/organization/permission-design.md first. Its core works with permission sets alone, and its optional default-access section explains why a global default suits a department scope only when everyone holding the action belongs to a department.

Development workflow

  1. Identify which records every holder of a particular operation should receive by default. A read baseline can be broad while edit remains preparer-only; do not copy read defaults into write operations.
  2. Confirm the composite, action and data scope exist and that the scope's grants target the intended collection. Reuse an applicable record access or define one through the main authorization Skill.
  3. Save one rule per resource under a stable key; a second rule on the same resource is rejected, so extend the existing rule instead. A rule lists every action and data scope it widens; updating it replaces the whole rule, and deleting it removes the baseline, not the permission-set action.
  4. Verify a holder receives the baseline, a person without the action remains denied, and restrictions still remove excluded rows. Also verify an explicit narrow data scope is not unexpectedly broadened by a permissive default.

For example, a quote view baseline can follow related-project ownership while editing follows the preparer, and a job's permission set can separately grant broad viewing that confidentiality restrictions narrow. A project's owner is not necessarily the author of every quote on that project.

Install

Register the default export of @nocobase/app-plugin-authz-default-access/client in client/plugins.ts and of @nocobase/app-plugin-authz-default-access/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 { defaultAccess } from '@nocobase/app-plugin-authz-default-access/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: [defaultAccess()] }),
);
export default authorization;

During setup the factory registers the settings item authorization.default-access (group authorization, actions read, create, update, delete) and its routes under /api/authorization/defaultAccess, 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 sales.prepared its own record access, both defined as the main Skill describes.

import { selection } from '@nocobase/authorization/core';
import {
  defineDefaultAccessRule,
  type DefaultAccessAuthorizationApi,
} from '@nocobase/authorization/default-access';
import type { DatabaseConnection } from '@nocobase/db';

if (!('defaultAccess' in authz))
  throw new Error('Default access is not configured');
const rules = (
  authz as typeof authz & DefaultAccessAuthorizationApi<DatabaseConnection>
).defaultAccess;

await rules.create(
  defineDefaultAccessRule('quotes-baseline', quotes.reference())
    .scope('edit', 'quotes', selection.recordAccess('s
अक्सर पूछे जाने वाले सवाल

क्या इससे नई अनुमतियाँ मिलती हैं?

नहीं। यह केवल उन लोगों के लिए साझा आधार जोड़ता है जिनके पास action पहले से है।

क्या restriction rules इसे ओवरराइड कर सकते हैं?

restriction rules फिर भी उन रिकॉर्ड को सीमित करते हैं जो डिफ़ॉल्ट पहुँच देती है।

क्या यह fields को भी कवर करता है?

नहीं। यह केवल वे रिकॉर्ड कवर करता है जहाँ action पहुँच सकता है, अतिरिक्त fields नहीं।

जानकारी

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

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

repo: nocobase/nocobase

लोकप्रियता

GitHub स्टार
25k
रैंकिंग में स्थान
#10091
लाइसेंस
—
अपडेट की गई
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