Grant the static super-admin mobile full ALL_RIDS and move slider into ثابتها permissions.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
* gated by `users.isSuperAdmin` in place instead.
|
||||
*
|
||||
* Keep in step with SUPER_ADMIN_RIDS in apps/api/src/modules/auth/super-admin.ts.
|
||||
* Login/JWT for that mobile grants the full ALL_RIDS set on the API side; this
|
||||
* set is only the tree-filter used when editing other roles' permissions.
|
||||
*/
|
||||
export const SUPER_ADMIN_RIDS: ReadonlySet<string> = new Set([
|
||||
'persons.create.single',
|
||||
|
||||
@@ -94,10 +94,10 @@
|
||||
<a-button class="mt-4" type="primary" @click="saveTags">ذخیره برچسب ها</a-button>
|
||||
</a-tab-pane>
|
||||
|
||||
<!-- اسلایدر موبایل — دسترسی جدا از بقیهی این صفحه، چون آپلود بنر عمومی
|
||||
سایت حساستر از ویرایش برند/برچسب است (custom.config.statics.slider) -->
|
||||
<!-- اسلایدر موبایل — دسترسی جدا (custom.config.statics.slider)؛ سوپرادمین
|
||||
همیشه میبیند حتی اگر نقشش آن rid را نداشته باشد. -->
|
||||
<a-tab-pane
|
||||
v-if="hasPermission('custom.config.statics.slider')"
|
||||
v-if="users.isSuperAdmin || hasPermission('custom.config.statics.slider')"
|
||||
key="slider"
|
||||
tab="اسلایدر موبایل"
|
||||
>
|
||||
@@ -370,7 +370,9 @@ onMounted(async () => {
|
||||
await Promise.all([loadBrands(), users.isSuperAdmin ? loadCollections() : Promise.resolve()]);
|
||||
const [t, s] = await Promise.all([
|
||||
api.get('const/__list__tags'),
|
||||
hasPermission('custom.config.statics.slider') ? api.get('const/slider') : Promise.resolve(null),
|
||||
users.isSuperAdmin || hasPermission('custom.config.statics.slider')
|
||||
? api.get('const/slider')
|
||||
: Promise.resolve(null),
|
||||
]);
|
||||
tags.value = Array.isArray(t.data) ? t.data : [];
|
||||
sliders.value = Array.isArray(s?.data) ? s.data : [];
|
||||
|
||||
@@ -827,6 +827,14 @@ export const treeData: PermissionNode[] = [
|
||||
"key": "config.statics.tags.remove"
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "اسلایدر موبایل",
|
||||
"key": "custom.config.statics.slider"
|
||||
},
|
||||
{
|
||||
"title": "برچسب بنر اول سایت",
|
||||
"key": "custom.config.statics.tags.banner.ids"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -855,19 +863,5 @@ export const treeData: PermissionNode[] = [
|
||||
{
|
||||
"title": "خبرنامه",
|
||||
"key": "newsletters.newsletters",
|
||||
},
|
||||
{
|
||||
"title": "سفارشی",
|
||||
"key": "custom",
|
||||
"children": [
|
||||
{
|
||||
"title": "اسلایدر موبایل",
|
||||
"key": "custom.config.statics.slider"
|
||||
},
|
||||
{
|
||||
"title": "برچسب بنر اول سایت",
|
||||
"key": "custom.config.statics.tags.banner.ids"
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user