import{r,p as c,q as h,w as t,z as s,t as a,R as e}from"./vendor.8ed37afc.js";const d={class:"markdown-body"},p={class:"two-up"},u={class:"left"},_=e("Permissions are assigned to Roles, and control data access throughout the platform. "),m=e("Learn more about Permissions"),g=e("."),j=s("div",{class:"right"},[s("p",null,[s("div",{class:"table-of-contents"},[s("ul",null,[s("li",null,[s("a",{href:"#the-permission-object"},"The Permission Object")]),s("li",null,[s("a",{href:"#list-permissions"},"List Permissions")]),s("li",null,[s("a",{href:"#retrieve-a-permission"},"Retrieve a Permission")]),s("li",null,[s("a",{href:"#create-a-permission-rule"},"Create a Permission Rule")]),s("li",null,[s("a",{href:"#create-multiple-permission-rules"},"Create Multiple Permission Rules")]),s("li",null,[s("a",{href:"#update-permissions"},"Update Permissions")]),s("li",null,[s("a",{href:"#update-multiple-permissions"},"Update Multiple Permissions")]),s("li",null,[s("a",{href:"#delete-permissions"},"Delete Permissions")]),s("li",null,[s("a",{href:"#delete-multiple-permissions"},"Delete Multiple Permissions")])])])])],-1),f=s("hr",null,null,-1),y=s("h2",{id:"the-permission-object"},[e("The Permission Object "),s("a",{class:"header-anchor",href:"#the-permission-object"},"#")],-1),b={class:"two-up"},q={class:"left"},x={class:"definitions"},P=s("p",null,[s("code",null,"id"),e(),s("strong",null,"uuid"),s("br"),e(" Primary key of the permission rule.")],-1),v=s("code",null,"role",-1),R=e(),E=s("strong",null,"many-to-one",-1),w=s("br",null,null,-1),T=e(" Role this permission applies to. Many-to-one to "),k=e("roles"),S=e(". "),A=s("code",null,"null",-1),D=e(" is used for public permissions."),L=s("p",null,[s("code",null,"collection"),e(),s("strong",null,"string"),s("br"),e(" Collection this permission rule applies to.")],-1),C=s("p",null,[s("code",null,"action"),e(),s("strong",null,"string"),s("br"),e(" What CRUD operation this permission rule applies to. One of "),s("code",null,"create"),e(", "),s("code",null,"read"),e(", "),s("code",null,"update"),e(", "),s("code",null,"delete"),e(".")],-1),Q=s("code",null,"permissions",-1),I=e(),M=s("strong",null,"object",-1),O=s("br",null,null,-1),G=e(" What rules the item must pass before the role is allowed to alter it. Follows "),B=e("the Filter Rules spec"),U=e("."),H=s("code",null,"validation",-1),W=e(),F=s("strong",null,"object",-1),N=s("br",null,null,-1),V=e(" What rules the provided values must pass before the role is allowed to submit them for insertion/update. Follows "),z=e("the Filter Rules spec"),J=e("."),K=s("p",null,[s("code",null,"preset"),e(),s("strong",null,"object"),s("br"),e(" Additional default values for the role.")],-1),X=s("p",null,[s("code",null,"fields"),e(),s("strong",null,"array"),s("br"),e(" What fields the user is allowed to alter.")],-1),Y=s("div",{class:"right"},[s("pre",null,[s("code",{class:"language-json"},[e(`{
	`),s("span",{class:"hljs-attr"},'"id"'),e(": "),s("span",{class:"hljs-number"},"34"),e(`,
	`),s("span",{class:"hljs-attr"},'"role"'),e(": "),s("span",{class:"hljs-string"},'"c86c2761-65d3-43c3-897f-6f74ad6a5bd7"'),e(`,
	`),s("span",{class:"hljs-attr"},'"collection"'),e(": "),s("span",{class:"hljs-string"},'"pages"'),e(`,
	`),s("span",{class:"hljs-attr"},'"action"'),e(": "),s("span",{class:"hljs-string"},'"create"'),e(`,
	`),s("span",{class:"hljs-attr"},'"permissions"'),e(": "),s("span",{class:"hljs-literal"},"null"),e(`,
	`),s("span",{class:"hljs-attr"},'"validation"'),e(`: {
		`),s("span",{class:"hljs-attr"},'"title"'),e(`: {
			`),s("span",{class:"hljs-attr"},'"_contains"'),e(": "),s("span",{class:"hljs-string"},'"Directus"'),e(`
		}
	},
	`),s("span",{class:"hljs-attr"},'"presets"'),e(`: {
		`),s("span",{class:"hljs-attr"},'"published"'),e(": "),s("span",{class:"hljs-literal"},"false"),e(`
	},
	`),s("span",{class:"hljs-attr"},'"fields"'),e(": ["),s("span",{class:"hljs-string"},'"title"'),e(", "),s("span",{class:"hljs-string"},'"translations"'),e(`]
}
`)])])],-1),Z=s("hr",null,null,-1),$=s("h2",{id:"list-permissions"},[e("List Permissions "),s("a",{class:"header-anchor",href:"#list-permissions"},"#")],-1),ss=s("p",null,"List all permissions that exist in Directus.",-1),es={class:"two-up"},ts={class:"left"},ls=s("div",{class:"tip hint"},[s("div",{class:"hint-title"},"Permissions"),s("p",null,"The data returned in this endpoint will be filtered based on the user\u2019s permissions. For example, permissions for a role other than the current user\u2019s role won\u2019t be returned.")],-1),as=s("h3",{id:"query-parameters"},[e("Query Parameters "),s("a",{class:"header-anchor",href:"#query-parameters"},"#")],-1),ns=e("Supports all "),rs=e("global query parameters"),os=e("."),is=s("h3",{id:"returns"},[e("Returns "),s("a",{class:"header-anchor",href:"#returns"},"#")],-1),cs=e("An array of up to "),hs=e("limit"),ds=e(),ps=s("a",{href:"#the-permission-object"},"permission objects",-1),us=e(". If no items are available, data will be an empty array."),_s={class:"right"},ms=s("h3",{id:"rest-api"},[e("REST API "),s("a",{class:"header-anchor",href:"#rest-api"},"#")],-1),gs=s("pre",null,[s("code",null,`GET /permissions
SEARCH /permissions
`)],-1),js=e("Learn more about SEARCH ->"),fs=s("h3",{id:"graphql"},[e("GraphQL "),s("a",{class:"header-anchor",href:"#graphql"},"#")],-1),ys=s("pre",null,[s("code",null,`POST /graphql/system
`)],-1),bs=s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"type"),s("span",{class:"hljs-type"}," Query"),e(` {
	permissions: directus_permissions
}
`)])],-1),qs=s("h5",{id:"example"},[e("Example "),s("a",{class:"header-anchor",href:"#example"},"#")],-1),xs=s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"query"),e(` {
	permissions {
		action
		role
		collection
	}
}
`)])],-1),Ps=s("hr",null,null,-1),vs=s("h2",{id:"retrieve-a-permission"},[e("Retrieve a Permission "),s("a",{class:"header-anchor",href:"#retrieve-a-permission"},"#")],-1),Rs=s("p",null,"List an existing permission by primary key.",-1),Es={class:"two-up"},ws={class:"left"},Ts=s("h3",{id:"query-parameters-2"},[e("Query Parameters "),s("a",{class:"header-anchor",href:"#query-parameters-2"},"#")],-1),ks=e("Supports all "),Ss=e("global query parameters"),As=e("."),Ds=s("h3",{id:"returns-2"},[e("Returns "),s("a",{class:"header-anchor",href:"#returns-2"},"#")],-1),Ls=s("p",null,[e("Returns the requested "),s("a",{href:"#the-permission-object"},"permission object"),e(".")],-1),Cs=s("div",{class:"right"},[s("h3",{id:"rest-api-2"},[e("REST API "),s("a",{class:"header-anchor",href:"#rest-api-2"},"#")]),s("pre",null,[s("code",null,`GET /permissions/:id
`)]),s("h5",{id:"example-2"},[e("Example "),s("a",{class:"header-anchor",href:"#example-2"},"#")]),s("pre",null,[s("code",{class:"language-json"},[s("span",{class:"hljs-comment"},"// GET /permissions/34"),e(`

{
	`),s("span",{class:"hljs-attr"},'"data"'),e(`: {
		`),s("span",{class:"hljs-attr"},'"id"'),e(": "),s("span",{class:"hljs-number"},"34"),e(`,
		`),s("span",{class:"hljs-attr"},'"role"'),e(": "),s("span",{class:"hljs-string"},'"c86c2761-65d3-43c3-897f-6f74ad6a5bd7"'),e(`,
		`),s("span",{class:"hljs-attr"},'"collection"'),e(": "),s("span",{class:"hljs-string"},'"pages"'),e(`,
		`),s("span",{class:"hljs-attr"},'"action"'),e(": "),s("span",{class:"hljs-string"},'"create"'),e(`,
		`),s("span",{class:"hljs-attr"},'"permissions"'),e(": "),s("span",{class:"hljs-literal"},"null"),e(`,
		`),s("span",{class:"hljs-attr"},'"validation"'),e(`: {
			`),s("span",{class:"hljs-attr"},'"title"'),e(`: {
				`),s("span",{class:"hljs-attr"},'"_contains"'),e(": "),s("span",{class:"hljs-string"},'"Directus"'),e(`
			}
		},
		`),s("span",{class:"hljs-attr"},'"presets"'),e(`: {
			`),s("span",{class:"hljs-attr"},'"published"'),e(": "),s("span",{class:"hljs-literal"},"false"),e(`
		},
		`),s("span",{class:"hljs-attr"},'"fields"'),e(": ["),s("span",{class:"hljs-string"},'"title"'),e(", "),s("span",{class:"hljs-string"},'"translations"'),e(`]
	}
}
`)])]),s("h3",{id:"graphql-2"},[e("GraphQL "),s("a",{class:"header-anchor",href:"#graphql-2"},"#")]),s("pre",null,[s("code",null,`POST /graphql/system
`)]),s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"type"),s("span",{class:"hljs-type"}," Query"),e(` {
	permissions_by_id(id:`),s("span",{class:"hljs-literal"}," ID"),e(`!): directus_permissions
}
`)])]),s("h5",{id:"example-3"},[e("Example "),s("a",{class:"header-anchor",href:"#example-3"},"#")]),s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"query"),e(` {
	permissions_by_id(id: `),s("span",{class:"hljs-number"},"34"),e(`) {
		role
		collection
		action
	}
}
`)])])],-1),Qs=s("hr",null,null,-1),Is=s("h2",{id:"create-a-permission-rule"},[e("Create a Permission Rule "),s("a",{class:"header-anchor",href:"#create-a-permission-rule"},"#")],-1),Ms=s("p",null,"Create a new permission rule",-1),Os={class:"two-up"},Gs={class:"left"},Bs=s("h3",{id:"query-parameters-3"},[e("Query Parameters "),s("a",{class:"header-anchor",href:"#query-parameters-3"},"#")],-1),Us=e("Supports all "),Hs=e("global query parameters"),Ws=e("."),Fs=s("h3",{id:"request-body"},[e("Request Body "),s("a",{class:"header-anchor",href:"#request-body"},"#")],-1),Ns=s("p",null,[e("A partial "),s("a",{href:"#the-permission-object"},"permissions object"),e(". "),s("code",null,"action"),e(" and "),s("code",null,"collection"),e(" are required.")],-1),Vs=s("h3",{id:"returns-3"},[e("Returns "),s("a",{class:"header-anchor",href:"#returns-3"},"#")],-1),zs=s("p",null,[e("Returns the "),s("a",{href:"#the-permission-object"},"permission object"),e(" for the created permission.")],-1),Js=s("div",{class:"right"},[s("h3",{id:"rest-api-3"},[e("REST API "),s("a",{class:"header-anchor",href:"#rest-api-3"},"#")]),s("pre",null,[s("code",null,`POST /permissions
`)]),s("h5",{id:"example-4"},[e("Example "),s("a",{class:"header-anchor",href:"#example-4"},"#")]),s("pre",null,[s("code",{class:"language-json"},[s("span",{class:"hljs-comment"},"// Request"),e(`

{
	`),s("span",{class:"hljs-attr"},'"collection"'),e(": "),s("span",{class:"hljs-string"},'"pages"'),e(`,
	`),s("span",{class:"hljs-attr"},'"action"'),e(": "),s("span",{class:"hljs-string"},'"read"'),e(`,
	`),s("span",{class:"hljs-attr"},'"role"'),e(": "),s("span",{class:"hljs-string"},'"c86c2761-65d3-43c3-897f-6f74ad6a5bd7"'),e(`,
	`),s("span",{class:"hljs-attr"},'"fields"'),e(": ["),s("span",{class:"hljs-string"},'"id"'),e(", "),s("span",{class:"hljs-string"},'"title"'),e(`]
}
`)])]),s("h3",{id:"graphql-3"},[e("GraphQL "),s("a",{class:"header-anchor",href:"#graphql-3"},"#")]),s("pre",null,[s("code",null,`POST /graphql/system
`)]),s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"type"),s("span",{class:"hljs-type"}," Mutation"),e(` {
	create_permissions_item(data: create_directus_permissions_input!): directus_permissions
}
`)])]),s("h5",{id:"example-5"},[e("Example "),s("a",{class:"header-anchor",href:"#example-5"},"#")]),s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"mutation"),e(` {
	create_permissions_item(
		data: { collection: `),s("span",{class:"hljs-string"},'"pages"'),e(", action: "),s("span",{class:"hljs-string"},'"read"'),e(", role: "),s("span",{class:"hljs-string"},'"c86c2761-65d3-43c3-897f-6f74ad6a5bd7"'),e(", fields: ["),s("span",{class:"hljs-string"},'"id"'),e(", "),s("span",{class:"hljs-string"},'"title"'),e(`] }
	) {
		id
		collection
		action
	}
}
`)])])],-1),Ks=s("hr",null,null,-1),Xs=s("h2",{id:"create-multiple-permission-rules"},[e("Create Multiple Permission Rules "),s("a",{class:"header-anchor",href:"#create-multiple-permission-rules"},"#")],-1),Ys=s("p",null,"Create multiple new permission rules",-1),Zs={class:"two-up"},$s={class:"left"},se=s("h3",{id:"query-parameters-4"},[e("Query Parameters "),s("a",{class:"header-anchor",href:"#query-parameters-4"},"#")],-1),ee=e("Supports all "),te=e("global query parameters"),le=e("."),ae=s("h3",{id:"request-body-2"},[e("Request Body "),s("a",{class:"header-anchor",href:"#request-body-2"},"#")],-1),ne=s("p",null,[e("An array of partial "),s("a",{href:"#the-permission-object"},"permissions objects"),e(". "),s("code",null,"action"),e(" and "),s("code",null,"collection"),e(" are required.")],-1),re=s("h3",{id:"returns-4"},[e("Returns "),s("a",{class:"header-anchor",href:"#returns-4"},"#")],-1),oe=s("p",null,[e("Returns the "),s("a",{href:"#the-permission-object"},"permission objects"),e(" for the created permissions.")],-1),ie=s("div",{class:"right"},[s("h3",{id:"rest-api-4"},[e("REST API "),s("a",{class:"header-anchor",href:"#rest-api-4"},"#")]),s("pre",null,[s("code",null,`POST /permissions
`)]),s("h5",{id:"example-6"},[e("Example "),s("a",{class:"header-anchor",href:"#example-6"},"#")]),s("pre",null,[s("code",{class:"language-json"},[s("span",{class:"hljs-comment"},"// Request"),e(`

[
	{
		`),s("span",{class:"hljs-attr"},'"collection"'),e(": "),s("span",{class:"hljs-string"},'"pages"'),e(`,
		`),s("span",{class:"hljs-attr"},'"action"'),e(": "),s("span",{class:"hljs-string"},'"read"'),e(`,
		`),s("span",{class:"hljs-attr"},'"role"'),e(": "),s("span",{class:"hljs-string"},'"c86c2761-65d3-43c3-897f-6f74ad6a5bd7"'),e(`,
		`),s("span",{class:"hljs-attr"},'"fields"'),e(": ["),s("span",{class:"hljs-string"},'"id"'),e(", "),s("span",{class:"hljs-string"},'"title"'),e(`]
	},
	{
		`),s("span",{class:"hljs-attr"},'"collection"'),e(": "),s("span",{class:"hljs-string"},'"pages"'),e(`,
		`),s("span",{class:"hljs-attr"},'"action"'),e(": "),s("span",{class:"hljs-string"},'"create"'),e(`,
		`),s("span",{class:"hljs-attr"},'"role"'),e(": "),s("span",{class:"hljs-string"},'"c86c2761-65d3-43c3-897f-6f74ad6a5bd7"'),e(`,
		`),s("span",{class:"hljs-attr"},'"fields"'),e(": ["),s("span",{class:"hljs-string"},'"id"'),e(", "),s("span",{class:"hljs-string"},'"title"'),e(`]
	}
]
`)])]),s("h3",{id:"graphql-4"},[e("GraphQL "),s("a",{class:"header-anchor",href:"#graphql-4"},"#")]),s("pre",null,[s("code",null,`POST /graphql/system
`)]),s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"type"),s("span",{class:"hljs-type"}," Mutation"),e(` {
	create_permissions_itemss(data: [create_directus_permissions_input!]!): [directus_permissions]
}
`)])]),s("h5",{id:"example-7"},[e("Example "),s("a",{class:"header-anchor",href:"#example-7"},"#")]),s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"mutation"),e(` {
	create_permissions_items(
		data: [
			{ collection: `),s("span",{class:"hljs-string"},'"pages"'),e(", action: "),s("span",{class:"hljs-string"},'"read"'),e(", role: "),s("span",{class:"hljs-string"},'"c86c2761-65d3-43c3-897f-6f74ad6a5bd7"'),e(", fields: ["),s("span",{class:"hljs-string"},'"id"'),e(", "),s("span",{class:"hljs-string"},'"title"'),e(`] }
			{ collection: `),s("span",{class:"hljs-string"},'"pages"'),e(", action: "),s("span",{class:"hljs-string"},'"create"'),e(", role: "),s("span",{class:"hljs-string"},'"c86c2761-65d3-43c3-897f-6f74ad6a5bd7"'),e(", fields: ["),s("span",{class:"hljs-string"},'"id"'),e(", "),s("span",{class:"hljs-string"},'"title"'),e(`] }
		]
	) {
		id
		collection
		action
	}
}
`)])])],-1),ce=s("hr",null,null,-1),he=s("h2",{id:"update-permissions"},[e("Update Permissions "),s("a",{class:"header-anchor",href:"#update-permissions"},"#")],-1),de=s("p",null,"Update an existing permissions rule.",-1),pe={class:"two-up"},ue={class:"left"},_e=s("h3",{id:"query-parameters-5"},[e("Query Parameters "),s("a",{class:"header-anchor",href:"#query-parameters-5"},"#")],-1),me=e("Supports all "),ge=e("global query parameters"),je=e("."),fe=s("h3",{id:"request-body-3"},[e("Request Body "),s("a",{class:"header-anchor",href:"#request-body-3"},"#")],-1),ye=s("p",null,[e("A partial "),s("a",{href:"#the-permission-object"},"permissions object"),e(".")],-1),be=s("h3",{id:"returns-5"},[e("Returns "),s("a",{class:"header-anchor",href:"#returns-5"},"#")],-1),qe=s("p",null,[e("Returns the "),s("a",{href:"#the-permission-object"},"permission object"),e(" for the updated permission.")],-1),xe=s("div",{class:"right"},[s("h3",{id:"rest-api-5"},[e("REST API "),s("a",{class:"header-anchor",href:"#rest-api-5"},"#")]),s("pre",null,[s("code",null,`PATCH /permissions/:id
`)]),s("h5",{id:"example-8"},[e("Example "),s("a",{class:"header-anchor",href:"#example-8"},"#")]),s("pre",null,[s("code",{class:"language-json"},[s("span",{class:"hljs-comment"},"// PATCH /permissions/34"),e(`

{
	`),s("span",{class:"hljs-attr"},'"fields"'),e(": ["),s("span",{class:"hljs-string"},'"id"'),e(", "),s("span",{class:"hljs-string"},'"title"'),e(", "),s("span",{class:"hljs-string"},'"body"'),e(`]
}
`)])]),s("h3",{id:"graphql-5"},[e("GraphQL "),s("a",{class:"header-anchor",href:"#graphql-5"},"#")]),s("pre",null,[s("code",null,`POST /graphql/system
`)]),s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"type"),s("span",{class:"hljs-type"}," Mutation"),e(` {
	update_permissions_item(id:`),s("span",{class:"hljs-literal"}," ID"),e(`!, data: update_directus_permissions_input!): directus_permissions
}
`)])]),s("h5",{id:"example-9"},[e("Example "),s("a",{class:"header-anchor",href:"#example-9"},"#")]),s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"mutation"),e(` {
	update_permissions_item(id: `),s("span",{class:"hljs-number"},"34"),e(", data: { fields: ["),s("span",{class:"hljs-string"},'"id"'),e(", "),s("span",{class:"hljs-string"},'"title"'),e(", "),s("span",{class:"hljs-string"},'"body"'),e(`] }) {
		id
		action
		collection
	}
}
`)])])],-1),Pe=s("hr",null,null,-1),ve=s("h2",{id:"update-multiple-permissions"},[e("Update Multiple Permissions "),s("a",{class:"header-anchor",href:"#update-multiple-permissions"},"#")],-1),Re=s("p",null,"Update multiple existing permissions rules.",-1),Ee={class:"two-up"},we={class:"left"},Te=s("h3",{id:"query-parameters-6"},[e("Query Parameters "),s("a",{class:"header-anchor",href:"#query-parameters-6"},"#")],-1),ke=e("Supports all "),Se=e("global query parameters"),Ae=e("."),De=s("h3",{id:"request-body-4"},[e("Request Body "),s("a",{class:"header-anchor",href:"#request-body-4"},"#")],-1),Le=s("h3",{id:"request-body-5"},[e("Request Body "),s("a",{class:"header-anchor",href:"#request-body-5"},"#")],-1),Ce=s("div",{class:"definitions"},[s("p",null,[s("code",null,"keys"),e(),s("strong",null,"Required"),s("br"),e(" Array of primary keys of the permissions you\u2019d like to update.")]),s("p",null,[s("code",null,"data"),e(),s("strong",null,"Required"),s("br"),e(" Any of "),s("a",{href:"#the-permission-object"},"the permission object"),e("\u2019s properties.")])],-1),Qe=s("h3",{id:"returns-6"},[e("Returns "),s("a",{class:"header-anchor",href:"#returns-6"},"#")],-1),Ie=s("p",null,[e("Returns the "),s("a",{href:"#the-permission-object"},"permission object"),e(" for the updated permissions.")],-1),Me=s("div",{class:"right"},[s("h3",{id:"rest-api-6"},[e("REST API "),s("a",{class:"header-anchor",href:"#rest-api-6"},"#")]),s("pre",null,[s("code",null,`PATCH /permissions
`)]),s("h5",{id:"example-10"},[e("Example "),s("a",{class:"header-anchor",href:"#example-10"},"#")]),s("pre",null,[s("code",{class:"language-json"},[s("span",{class:"hljs-comment"},"// PATCH /permissions"),e(`

{
	`),s("span",{class:"hljs-attr"},'"keys"'),e(": ["),s("span",{class:"hljs-number"},"34"),e(", "),s("span",{class:"hljs-number"},"65"),e(`],
	`),s("span",{class:"hljs-attr"},'"data"'),e(`: {
		`),s("span",{class:"hljs-attr"},'"fields"'),e(": ["),s("span",{class:"hljs-string"},'"id"'),e(", "),s("span",{class:"hljs-string"},'"title"'),e(", "),s("span",{class:"hljs-string"},'"body"'),e(`]
	}
}
`)])]),s("h3",{id:"graphql-6"},[e("GraphQL "),s("a",{class:"header-anchor",href:"#graphql-6"},"#")]),s("pre",null,[s("code",null,`POST /graphql/system
`)]),s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"type"),s("span",{class:"hljs-type"}," Mutation"),e(` {
	update_permissions_items(id: `),s("span",{class:"hljs-literal"},"[ID"),e(`!]!, data: update_directus_permissions_input!): [directus_permissions]
}
`)])]),s("h5",{id:"example-11"},[e("Example "),s("a",{class:"header-anchor",href:"#example-11"},"#")]),s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"mutation"),e(` {
	update_permissions_items(ids: [`),s("span",{class:"hljs-number"},"34"),e(", "),s("span",{class:"hljs-number"},"64"),e("], data: { fields: ["),s("span",{class:"hljs-string"},'"id"'),e(", "),s("span",{class:"hljs-string"},'"title"'),e(", "),s("span",{class:"hljs-string"},'"body"'),e(`] }) {
		id
		action
		collection
	}
}
`)])])],-1),Oe=s("hr",null,null,-1),Ge=s("h2",{id:"delete-permissions"},[e("Delete Permissions "),s("a",{class:"header-anchor",href:"#delete-permissions"},"#")],-1),Be=s("p",null,"Delete an existing permissions rule",-1),Ue=s("div",{class:"two-up"},[s("div",{class:"left"},[s("h3",{id:"returns-7"},[e("Returns "),s("a",{class:"header-anchor",href:"#returns-7"},"#")]),s("p",null,"Empty body.")]),s("div",{class:"right"},[s("h3",{id:"rest-api-7"},[e("REST API "),s("a",{class:"header-anchor",href:"#rest-api-7"},"#")]),s("pre",null,[s("code",null,`DELETE /permissions/:id
`)]),s("h5",{id:"example-12"},[e("Example "),s("a",{class:"header-anchor",href:"#example-12"},"#")]),s("pre",null,[s("code",null,`DELETE /permissions/34
`)]),s("h3",{id:"graphql-7"},[e("GraphQL "),s("a",{class:"header-anchor",href:"#graphql-7"},"#")]),s("pre",null,[s("code",null,`POST /graphql/system
`)]),s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"type"),s("span",{class:"hljs-type"}," Mutation"),e(` {
	delete_permissions_item(id:`),s("span",{class:"hljs-literal"}," ID"),e(`!): delete_one
}
`)])]),s("h5",{id:"example-13"},[e("Example "),s("a",{class:"header-anchor",href:"#example-13"},"#")]),s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"mutation"),e(` {
	delete_permissions_item(id: `),s("span",{class:"hljs-number"},"34"),e(`) {
		id
	}
}
`)])])])],-1),He=s("hr",null,null,-1),We=s("h2",{id:"delete-multiple-permissions"},[e("Delete Multiple Permissions "),s("a",{class:"header-anchor",href:"#delete-multiple-permissions"},"#")],-1),Fe=s("p",null,"Delete multiple existing permissions rules",-1),Ne=s("div",{class:"two-up"},[s("div",{class:"left"},[s("h3",{id:"request-body-6"},[e("Request Body "),s("a",{class:"header-anchor",href:"#request-body-6"},"#")]),s("p",null,"An array of permission primary keys"),s("h3",{id:"returns-8"},[e("Returns "),s("a",{class:"header-anchor",href:"#returns-8"},"#")]),s("p",null,"Empty body.")]),s("div",{class:"right"},[s("h3",{id:"rest-api-8"},[e("REST API "),s("a",{class:"header-anchor",href:"#rest-api-8"},"#")]),s("pre",null,[s("code",null,`DELETE /permissions
`)]),s("h5",{id:"example-14"},[e("Example "),s("a",{class:"header-anchor",href:"#example-14"},"#")]),s("pre",null,[s("code",{class:"language-json"},[s("span",{class:"hljs-comment"},"// DELETE /permissions"),e(`

[`),s("span",{class:"hljs-number"},"34"),e(", "),s("span",{class:"hljs-number"},"64"),e(`]
`)])]),s("h3",{id:"graphql-8"},[e("GraphQL "),s("a",{class:"header-anchor",href:"#graphql-8"},"#")]),s("pre",null,[s("code",null,`POST /graphql/system
`)]),s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"type"),s("span",{class:"hljs-type"}," Mutation"),e(` {
	delete_permissions_items(ids: `),s("span",{class:"hljs-literal"},"[ID"),e(`!]!): delete_many
}
`)])]),s("h5",{id:"example-15"},[e("Example "),s("a",{class:"header-anchor",href:"#example-15"},"#")]),s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"mutation"),e(` {
	delete_permissions_items(ids: [`),s("span",{class:"hljs-number"},"34"),e(", "),s("span",{class:"hljs-number"},"64"),e(`]) {
		ids
	}
}
`)])])])],-1),Ve=s("hr",null,null,-1),Ye={setup(ze,{expose:o}){const n={title:"Permissions",modularExtension:!1,pageClass:"page-reference"};return o({frontmatter:n}),(Je,Ke)=>{const l=r("router-link"),i=r("DocsWrapper");return c(),h(i,{frontmatter:n},{default:t(()=>[s("div",d,[s("div",p,[s("div",u,[s("blockquote",null,[s("p",null,[_,a(l,{to:"/docs/getting-started/glossary/#permissions"},{default:t(()=>[m]),_:1}),g])])]),j]),f,y,s("div",b,[s("div",q,[s("div",x,[P,s("p",null,[v,R,E,w,T,a(l,{to:"/docs/reference/system/roles/"},{default:t(()=>[k]),_:1}),S,A,D]),L,C,s("p",null,[Q,I,M,O,G,a(l,{to:"/docs/configuration/filter-rules"},{default:t(()=>[B]),_:1}),U]),s("p",null,[H,W,F,N,V,a(l,{to:"/docs/configuration/filter-rules"},{default:t(()=>[z]),_:1}),J]),K,X])]),Y]),Z,$,ss,s("div",es,[s("div",ts,[ls,as,s("p",null,[ns,a(l,{to:"/docs/reference/query"},{default:t(()=>[rs]),_:1}),os]),is,s("p",null,[cs,a(l,{to:"/docs/reference/query/#limit"},{default:t(()=>[hs]),_:1}),ds,ps,us])]),s("div",_s,[ms,gs,s("p",null,[a(l,{to:"/docs/reference/introduction/#search-http-method"},{default:t(()=>[js]),_:1})]),fs,ys,bs,qs,xs])]),Ps,vs,Rs,s("div",Es,[s("div",ws,[Ts,s("p",null,[ks,a(l,{to:"/docs/reference/query"},{default:t(()=>[Ss]),_:1}),As]),Ds,Ls]),Cs]),Qs,Is,Ms,s("div",Os,[s("div",Gs,[Bs,s("p",null,[Us,a(l,{to:"/docs/reference/query"},{default:t(()=>[Hs]),_:1}),Ws]),Fs,Ns,Vs,zs]),Js]),Ks,Xs,Ys,s("div",Zs,[s("div",$s,[se,s("p",null,[ee,a(l,{to:"/docs/reference/query"},{default:t(()=>[te]),_:1}),le]),ae,ne,re,oe]),ie]),ce,he,de,s("div",pe,[s("div",ue,[_e,s("p",null,[me,a(l,{to:"/docs/reference/query"},{default:t(()=>[ge]),_:1}),je]),fe,ye,be,qe]),xe]),Pe,ve,Re,s("div",Ee,[s("div",we,[Te,s("p",null,[ke,a(l,{to:"/docs/reference/query"},{default:t(()=>[Se]),_:1}),Ae]),De,Le,Ce,Qe,Ie]),Me]),Oe,Ge,Be,Ue,He,We,Fe,Ne,Ve])]),_:1})}}};export{Ye as default};
