feat(roles): let each section decide who may assign work to others
Section access now only creates a record for yourself. Assigning it to a colleague requires a separate permission on that section. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -38,6 +38,7 @@ import {
|
||||
} from '@ant-design/icons-vue';
|
||||
import { api } from '@/lib/api';
|
||||
import { useAuthStore } from '@/stores/auth';
|
||||
import { canAssignToOthers } from '@/lib/assign-access';
|
||||
import { canUseBehavior } from '@/lib/behavior-access';
|
||||
import { toFaDigits } from '@/lib/jalali';
|
||||
import { currencySuffix, formatMoney } from '@/lib/money';
|
||||
@@ -180,6 +181,7 @@ const personSelectOptions = computed(() =>
|
||||
const companySelectOptions = computed(() =>
|
||||
companies.value.map((c) => ({ value: c.id, label: c.name })),
|
||||
);
|
||||
const canAssignOthers = computed(() => canAssignToOthers(auth.user, 'sales'));
|
||||
const ownerSelectOptions = computed(() =>
|
||||
users.value.map((u) => ({ value: u.id, label: u.fullName })),
|
||||
);
|
||||
@@ -772,13 +774,14 @@ onMounted(load);
|
||||
v-model:value="ownerId"
|
||||
show-search
|
||||
option-filter-prop="label"
|
||||
:disabled="!canAssignOthers"
|
||||
:options="ownerSelectOptions"
|
||||
placeholder="انتخاب مسئول"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :md="12">
|
||||
<a-col v-if="canAssignOthers" :xs="24" :md="12">
|
||||
<a-form-item label="مسئولان مشترک">
|
||||
<UserMultiSelect v-model="selectedAssigneeIds" :users="users" />
|
||||
<a-typography-text type="secondary">علاوه بر مسئول اصلی.</a-typography-text>
|
||||
|
||||
Reference in New Issue
Block a user