refactor(directory) : gate report actions via RBAC permissions + guard report deletion
- replace hardcoded ROLE_ADMIN check with usePermissions().can('directory.{clients,prospects}.manage')
- rename misleading isAdmin prop to canManage in CommercialReportTab and ReportDocumentList
- add busy guard on delete confirmation modal to prevent duplicate DELETE on double-click
This commit is contained in:
@@ -13,12 +13,14 @@
|
||||
variant="tertiary"
|
||||
:label="$t('common.cancel')"
|
||||
button-class="w-auto px-4"
|
||||
:disabled="busy"
|
||||
@click="cancel"
|
||||
/>
|
||||
<MalioButton
|
||||
variant="danger"
|
||||
:label="$t('common.delete')"
|
||||
button-class="w-auto px-4"
|
||||
:disabled="busy"
|
||||
@click="$emit('confirm')"
|
||||
/>
|
||||
</div>
|
||||
@@ -29,8 +31,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
defineProps<{
|
||||
const props = defineProps<{
|
||||
modelValue: boolean
|
||||
// Suppression en cours : on désactive les actions pour éviter un double envoi.
|
||||
busy?: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -39,6 +43,7 @@ const emit = defineEmits<{
|
||||
}>()
|
||||
|
||||
function cancel() {
|
||||
if (props.busy) return
|
||||
emit('update:modelValue', false)
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user