Skip to content

Instantly share code, notes, and snippets.

@Alxandr
Last active October 30, 2024 09:48
Show Gist options
  • Save Alxandr/a156418ce285c772ac17cb985886baee to your computer and use it in GitHub Desktop.
Save Alxandr/a156418ce285c772ac17cb985886baee to your computer and use it in GitHub Desktop.
{
// not part of the resource - just here to describe what kind of resource this is about
"_description": "Resurs som delegeres i 'biter'",
"actions": null,
"subResources": {
"create": {
"type": "write", // this is an enum used to determin what kind of icon to show in the UI
"name": {
"nb": "Opprett skjema",
"en": "Create form"
},
"description": {
"nb": "Opprett et nytt skjema",
"en": "Create a new form"
},
// this subresource has no attributes, meaning it's just a container for actions and really applies to the whole resource
"attributes": [],
"actions": {
"groups": {
// default is a special name for the default group - it's what's delegated by default if the user makes no choice
"default": {
"name": {
"nb": "Opprett skjema",
"en": "Create form"
},
"actions": [
"instantiate"
]
}
},
"items": {
"instantiate": {
"name": {
"nb": "Opprett",
"en": "Create"
}
}
}
}
},
"read-archive": {
"type": "read", // this is an enum used to determin what kind of icon to show in the UI
"name": {
"nb": "Arkivlesing",
"en": "Read archive"
},
"description": {
"nb": "Les arkiverte skjema",
"en": "Read archived forms"
},
// this subresource has no attributes, meaning it's just a container for actions and really applies to the whole resource
"attributes": [],
"actions": {
"groups": {
// default is a special name for the default group - it's what's delegated by default if the user makes no choice
"default": {
"name": {
"nb": "Les arkiv",
"en": "Read archive"
},
"actions": [
"read-archive"
]
}
},
"items": {
"read-archive": {
"name": {
"nb": "Les arkiv",
"en": "Read archive"
}
}
}
}
},
"write": {
"type": "write", // this is an enum used to determin what kind of icon to show in the UI
"name": {
"nb": "Utfylling",
"en": "Write"
},
"description": {
"nb": "Fyll ut et skjema",
"en": "Fill out a form"
},
// this subresource is a altinn app task with the task-id "write"
"attributes": [
{
"type": "urn:altinn:task",
"value": "write"
}
],
"actions": {
"groups": {
// default is a special name for the default group - it's what's delegated by default if the user makes no choice
"default": {
"name": {
"nb": "Lesetilgang",
"en": "Read access"
},
"actions": [
"read"
]
},
"write": {
"name": {
"nb": "Utfylling",
"en": "Write"
},
"actions": [
"read",
"write"
]
}
},
"items": {
"read": {
"name": {
"nb": "Les",
"en": "Read"
}
},
"write": {
"name": {
"nb": "Skriv",
"en": "Write"
}
}
}
}
},
"sign": {
"type": "sign", // this is an enum used to determin what kind of icon to show in the UI
"name": {
"nb": "Signering",
"en": "Signing"
},
"description": {
"nb": "Signer et skjema",
"en": "Sign a form"
},
// this subresource is a altinn app task with the task-id "sign"
"attributes": [
{
"type": "urn:altinn:task",
"value": "sign"
}
],
"actions": {
// this subresource has no default group - meaing the default is "none"
"groups": {
"read": {
"name": {
"nb": "Lesetilgang",
"en": "Read access"
},
"actions": [
"read"
]
},
"sign": {
"name": {
"nb": "Signering",
"en": "Signing"
},
"actions": [
"read",
"sign"
]
}
},
"items": {
"read": {
"name": {
"nb": "Les",
"en": "Read"
}
},
"sign": {
"name": {
"nb": "Signer",
"en": "Sign"
}
}
}
}
}
}
}
{
// not part of the resource - just here to describe what kind of resource this is about
"_description": "Resurs hvor hele delegeres",
"actions": {
"groups": {
// default is a special name for the default group - it's what's delegated by default if the user makes no choice
"default": {
"name": {
"nb": "Lesetilgang",
"en": "Read access"
},
"actions": [
"read"
]
},
// sign group - requires reading and signing access
"sign": {
"name": {
"nb": "Signering",
"en": "Signing"
},
"actions": [
"read",
"sign"
]
},
// write group - requires reading and writing access, as well as the ability to create a new instance
"write": {
"name": {
"nb": "Utfylling",
"en": "Write"
},
"actions": [
"instantiate",
"read",
"write"
]
}
},
"items": {
"read": {
"name": {
"nb": "Les",
"en": "Read"
}
},
"instantiate": {
"name": {
"nb": "Opprett",
"en": "Create"
}
},
"sign": {
"name": {
"nb": "Signer",
"en": "Sign"
}
},
"write": {
"name": {
"nb": "Skriv",
"en": "Write"
}
}
}
},
"subResources": null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment