Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
resource "tailor_tailordb_gql_permission" "product" {
workspace_id = tailor_workspace.ims.id
namespace = tailor_tailordb.ims.namespace
type = tailor_tailordb_type.product.name

policies = [
{
conditions = [
{ left = { user = "role" }, operator = "eq", right = { value = { string = "ADMIN" } } }
]
actions = ["all"]
permit = "allow"
description = "Administrators have full access to all GraphQL operations"
},
{
conditions = [
{ left = { user = "_loggedIn" }, operator = "eq", right = { value = { boolean = true } } }
]
actions = ["create", "read", "update"]
permit = "allow"
description = "Authenticated users can create, read, and update tasks"
},
]
}
39 changes: 38 additions & 1 deletion docs/sample-inventory-management/tailordb_product.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,42 @@ resource "tailor_tailordb_type" "product" {
}
}

type_permission = local.permission_everyone
permission = {
create = [
{
conditions = [
{ left = { user = "role" }, operator = "eq", right = { value = { string = "ADMIN" } } }
]
permit = "allow"
description = "Administrators can create any task"
},
]
read = [
{
conditions = [
{ left = { user = "role" }, operator = "eq", right = { value = { string = "ADMIN" } } }
]
permit = "allow"
description = "Administrators can read all tasks"
},
]
update = [
{
conditions = [
{ left = { user = "role" }, operator = "eq", right = { value = { string = "ADMIN" } } }
]
permit = "allow"
description = "Administrators can update any task"
},
]
delete = [
{
conditions = [
{ left = { user = "role" }, operator = "eq", right = { value = { string = "ADMIN" } } }
]
permit = "allow"
description = "Administrators can delete any task"
}
]
}
}