{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":2442,"path":"application-development/servicenow-sdk/cs-privileges-api-now-ts.md","title":"Cross-Scope Privilege API - ServiceNow Fluent","bundle":null,"doc_type":null,"release":"australia","body":"\n# Cross-Scope Privilege API - ServiceNow Fluent\n\nThe Cross-Scope Privilege API defines cross-scope privileges \\[sys\\_scope\\_privilege\\] for runtime access tracking.\n\n**Note:** For the latest ServiceNow Fluent API documentation and examples, see the [ServiceNow Fluent API reference](https://servicenow.github.io/sdk/category/api-reference) and [ServiceNow SDK examples repository](https://github.com/ServiceNow/sdk-examples) on GitHub.\n\nRuntime access tracking allows administrators to manage script access to application resources by creating a list of script operations and targets that the system authorizes to run. For general information about cross-scope privileges, see [Cross-scope privilege record](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/c_CrossScopePrivilegeRecord.md).\n\n**Parent Topic:**[ServiceNow Fluent API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/servicenow-fluent-api-reference.md)\n\n**Related topics**  \n\n\n[ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-fluent.md)\n\n## CrossScopePrivilege object\n\nConfigure cross-scope privileges \\[sys\\_scope\\_privilege\\] that determine which script operations and targets the system allows to run in the application.\n\n<table id=\"table_vy2_525_jq\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\n$id\n\n</td><td>\n\nString or Number\n\n</td><td>\n\nRequired. A unique ID for the metadata object. When you build the application, this ID is hashed into a unique sys\\_id. For more information, see [ServiceNow Fluent language constructs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-constructs.md).Format: `Now.ID['String' or Number]`\n\n</td></tr><tr><td>\n\nstatus\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. The authorization for this record.Valid values:\n\n-   requested\n-   allowed\n-   denied\n\n</td></tr><tr><td>\n\noperation\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. The operation that the script performs on the target. The target type determines the available operations. Tables \\[sys\\_db\\_object\\] support the read, write, create, and delete operations. Script includes \\[sys\\_script\\_include\\] and script objects \\[sys\\_db\\_object\\] only support the execute operation.\n\nValid values:\n\n-   create\n-   delete\n-   read\n-   write\n-   execute\n\n</td></tr><tr><td>\n\ntargetName\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. The name of the table, script include, or script object being requested.\n\n</td></tr><tr><td>\n\ntargetScope\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. The application scope from which resources are requested.\n\n</td></tr><tr><td>\n\ntargetType\n\n</td><td>\n\nString\n\n</td><td>\n\nRequired. The type of request: script include, script object, or table.Valid values:\n\n-   sys\\_script\\_include\n-   scriptable\n-   sys\\_db\\_object\n\n</td></tr><tr><td>\n\n$meta\n\n</td><td>\n\nObject\n\n</td><td>\n\nMetadata for the application metadata.With the installMethod property, you can map the application metadata to an output directory that loads only in specific circumstances.\n\n```javascript\n$meta: {\n      installMethod: 'String'\n}\n```\n\nValid values for installMethod:\n\n-   demo: Outputs the application metadata to the `metadata/unload.demo` directory to be installed with the application when the **Load demo data** option is selected.\n-   first install: Outputs the application metadata to the `metadata/unload` directory to be installed only the first time an application is installed on an instance.\n\n</td></tr></tbody>\n</table>```javascript\nimport { CrossScopePrivilege } from '@servicenow/sdk/core'\n\nCrossScopePrivilege({\n   $id: Now.ID['cross_1'],\n   status: 'allowed',\n   operation: 'execute',\n   targetName: 'Script type',\n   targetScope: 'x_snc_example',\n   targetType: 'scriptable',\n})\n```\n\n"}}