Grant senior_editor oil editing, PDF export, and public recipe management
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 4s
Test / build-check (push) Successful in 3s
PR Preview / test (pull_request) Successful in 4s
PR Preview / deploy-preview (pull_request) Successful in 20s
Test / e2e-test (push) Failing after 1m2s
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 4s
Test / build-check (push) Successful in 3s
PR Preview / test (pull_request) Successful in 4s
PR Preview / deploy-preview (pull_request) Successful in 20s
Test / e2e-test (push) Failing after 1m2s
Add canManage computed (senior_editor + admin) to auth store and use it for oil edit/delete buttons, PDF export, and public recipe section visibility. Backend already allowed these operations for senior_editor. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,9 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
// Getters
|
||||
const isLoggedIn = computed(() => user.value.id !== null)
|
||||
const isAdmin = computed(() => user.value.role === 'admin')
|
||||
const canManage = computed(() =>
|
||||
['senior_editor', 'admin'].includes(user.value.role)
|
||||
)
|
||||
const canEdit = computed(() =>
|
||||
['editor', 'senior_editor', 'admin'].includes(user.value.role)
|
||||
)
|
||||
@@ -91,6 +94,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
user,
|
||||
isLoggedIn,
|
||||
isAdmin,
|
||||
canManage,
|
||||
canEdit,
|
||||
isBusiness,
|
||||
initToken,
|
||||
|
||||
Reference in New Issue
Block a user