feat(api): all usable routes behind authentication now have permissions
Previously, only routes which were coming from crudable entities could be used with an api token because there was no way to assign permissions to them. This change implements a more flexible structure for api permissions under the hood, allowing to add permissions for these routes and making them usable with an api token. Resolves https://github.com/go-vikunja/vikunja/issues/266
This commit is contained in:
@ -47,7 +47,17 @@ const flatPickerConfig = computed(() => ({
|
||||
|
||||
onMounted(async () => {
|
||||
tokens.value = await service.getAll()
|
||||
availableRoutes.value = await service.getAvailableRoutes()
|
||||
const allRoutes = await service.getAvailableRoutes()
|
||||
|
||||
const routesAvailable = {}
|
||||
const keys = Object.keys(allRoutes)
|
||||
keys.sort((a, b) => (a === 'other' ? 1 : b === 'other' ? -1 : 0))
|
||||
keys.forEach(key => {
|
||||
routesAvailable[key] = allRoutes[key]
|
||||
})
|
||||
|
||||
availableRoutes.value = routesAvailable
|
||||
|
||||
resetPermissions()
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user