51 lines
1.9 KiB
Markdown
51 lines
1.9 KiB
Markdown
---
|
|
task: In ListProductsMarket.vue, hide the "+ New Product" button for all non-Big-3 account types — currently v-if="isUltimate", should be v-if="isUltimate || isSuperOperator || isOperator"
|
|
cycles: 5
|
|
context: true
|
|
private: false
|
|
started: 2026-05-28T16:46:18Z
|
|
finished: 2026-05-28T16:46:23Z
|
|
---
|
|
|
|
## files
|
|
- resources/js/Pages/ListProductsMarket.vue [lines 18-72] — contains the useAuth destructure (line 19) and the button v-if guard (line 69)
|
|
- resources/js/composables/Core/useAuth.js [lines 102-124] — exports isUltimate, isSuperOperator, isOperator
|
|
|
|
## steps
|
|
1. In `resources/js/Pages/ListProductsMarket.vue` line 19, change:
|
|
`const { isUltimate } = useAuth();`
|
|
to:
|
|
`const { isUltimate, isSuperOperator, isOperator } = useAuth();`
|
|
2. On line 69 of the same file, change:
|
|
`v-if="isUltimate"`
|
|
to:
|
|
`v-if="isUltimate || isSuperOperator || isOperator"`
|
|
3. Run `npm run build` to rebuild frontend assets.
|
|
4. Run `docker restart bukidbountyapp` to apply the new build.
|
|
|
|
## context
|
|
```
|
|
// resources/js/Pages/ListProductsMarket.vue
|
|
// line 19 (current)
|
|
const { isUltimate } = useAuth();
|
|
|
|
// line 69 (current)
|
|
<button v-if="isUltimate" @click="navigate({ page: 'CreateProductUltimate' })"
|
|
class="btn btn-sm btn-primary rounded-pill px-3 py-1">
|
|
<i class="fas fa-plus me-1"></i> New Product
|
|
</button>
|
|
|
|
// resources/js/composables/Core/useAuth.js
|
|
// lines 102-124
|
|
const isUltimate = computed(() => role.value === UserTypes.ULTIMATE);
|
|
const isSuperOperator = computed(() => role.value === UserTypes.SUPER_OPERATOR);
|
|
const isOperator = computed(() => role.value === UserTypes.OPERATOR);
|
|
// ...
|
|
return { isUltimate, isSuperOperator, isOperator, ... };
|
|
```
|
|
|
|
## notes
|
|
- dictionary: ai-docs/dictionary.md
|
|
- linters: none
|
|
- constraints: Big 3 = ULTIMATE, SUPER_OPERATOR, OPERATOR per dictionary. STORE_OWNER and below must NOT see the button. No backend changes required — frontend-only visibility guard.
|