Skip to content

Instantly share code, notes, and snippets.

@tolgaOzen
Created March 2, 2022 15:45
Show Gist options
  • Save tolgaOzen/2b6a3fec5111aad7ceedb5726c7f2967 to your computer and use it in GitHub Desktop.
Save tolgaOzen/2b6a3fec5111aad7ceedb5726c7f2967 to your computer and use it in GitHub Desktop.
result policy object
{
"name": "task edit policy",
"guard_name": "task-edit-policy",
"description": "",
"options": [
{
"name": "senior manager",
"guard_name": "senior-manager",
"rules": [
{
"name": "is senior",
"guard_name": "is-senior",
"description": "",
"conditions": [
"user.attributes.tenure > 8"
]
},
{
"name": "is manager",
"guard_name": "is-manager",
"description": "",
"conditions": [
"\"manager\" in user.roles"
]
}
]
},
{
"name": "resource owner",
"guard_name": "resource owner",
"rules": [
{
"name": "is resource owner",
"guard_name": "is-resource-owner",
"description": "",
"conditions": [
"user.id == resource.attributes.owner_id"
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment