jfrog_create_permission_target
Define and manage access permissions for resources in the JFrog Platform by creating a new permission target. Specify user and group actions, including READ, WRITE, and MANAGE, for artifacts, builds, and release bundles.
Instructions
Create a new permission target in the JFrog platform
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| created_by | No | ||
| modified_by | No | ||
| name | Yes | ||
| resources | Yes |
Implementation Reference
- tools/permissions.ts:198-200 (handler)The handler function for the jfrog_create_permission_target tool. It receives the tool arguments and delegates to the createPermissionTarget helper function.handler: async (args: any) => { return await createPermissionTarget(args); }
- tools/permissions.ts:83-89 (helper)Core helper function that performs the HTTP POST request to the JFrog Platform's Access API to create a new permission target and validates the response.export async function createPermissionTarget(permissionTarget: z.infer<typeof PermissionTargetSchema>) { const response = await jfrogRequest("/access/api/v2/permissions", { method: "POST", body: permissionTarget }); return PermissionTargetSchema.parse(response); }
- tools/permissions.ts:45-54 (schema)Zod schema defining the structure of the permission target object, used for input validation in the tool's inputSchema via zodToJsonSchema.const PermissionTargetSchema = z.object({ name: z.string(), resources: z.object({ artifact: ArtifactResourceSchema.optional(), release_bundle: ReleaseBundleResourceSchema.optional(), build: BuildResourceSchema.optional() }), created_by: z.string().optional(), modified_by: z.string().optional() });
- tools/permissions.ts:193-201 (registration)Tool object registration defining the name, description, input schema, and handler for jfrog_create_permission_target.const createPermissionTargetTool = { name: "jfrog_create_permission_target", description: "Create a new permission target in the JFrog platform", inputSchema: zodToJsonSchema(PermissionTargetSchema), //outputSchema: zodToJsonSchema(PermissionTargetSchema), handler: async (args: any) => { return await createPermissionTarget(args); } };
- tools/permissions.ts:288-298 (registration)Export of the PermissionsTools array, which includes the jfrog_create_permission_target tool (at index for createPermissionTargetTool). This array is imported and spread into the main tools list in tools/index.ts.export const PermissionsTools = [ listPermissionTargetsTool, getPermissionTargetTool, createPermissionTargetTool, updatePermissionTargetTool, deletePermissionTargetTool, getPermissionResourceTool, updatePermissionResourceTool, replacePermissionResourceTool, deletePermissionResourceTool ];