Xodimlar rollari
«Sozlamalar» → «Xodimlar» → «Rollar» (AR-293): Super Admin xodimi nimani ko‘radi va qiladi. Rol katalog kalitlari bilan beriladi (GET catalog): bo‘lim ekranni, amal tugmani ochadi; marshrutlar kalitlardan chiqariladi va server tekshiradi. 1-rol «Super-admin» — faqat ko‘rish uchun, unda barcha huquqlar bor. O‘zingizda bo‘lmagan huquqni berib bo‘lmaydi.
| Metod | Manzil | Vazifasi |
|---|---|---|
| GET | /admin/system/role/catalog | Huquqlar katalogi |
| GET | /admin/system/role | Xodim rollari ro‘yxati |
| GET | /admin/system/role/{model} | Rol kartasi |
| POST | /admin/system/role | Rol yaratish |
| PUT | /admin/system/role/{model} | Rolni saqlash |
| DELETE | /admin/system/role/{model} | Rolni o‘chirish |
Huquqlar katalogi
Rol muharririning «Bo‘lim — Kirish» jadvali: menyu guruhlari (main, wasyt, partner, settings) → bo‘limlar → amallar (<bo‘lim>.<amal>), har birida u ochadigan routes marshrutlari (prevyu qolganini shular bo‘yicha yashiradi). Yorliqlar interfeys tomonida.
/admin/system/role/catalogSarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
data | object[] | Ma'lumotlar |
data[].key | string | Voqea |
data[].sections | object[] | |
data[].sections[].key | string | Voqea |
data[].sections[].routes | array | Bo'limlar |
data[].sections[].actions | array |
{
"data": [
{
"key": "main",
"sections": [
{
"key": "home",
"routes": [
"admin.company.overview.cards",
"admin.company.overview.partners"
],
"actions": []
}
]
},
{
"key": "wasyt",
"sections": [
{
"key": "companies",
"routes": [
"admin.company.company.index",
"admin.company.company.show"
],
"actions": [
{
"key": "companies.create",
"routes": [
"admin.company.company.create"
]
},
{
"key": "companies.toggle",
"routes": [
"admin.company.company.delete",
"admin.company.company.restore"
]
}
]
},
{
"key": "transactions",
"routes": [
"admin.company.transaction.index",
"admin.company.transaction.show"
],
"actions": [
{
"key": "transactions.cancel",
"routes": [
"admin.company.transaction.cancel",
"admin.company.transaction.document"
]
}
]
}
]
}
]
}Xodim rollari ro‘yxati
Super Admin rollari: permissions — yoqilgan kalitlar, sections_count / sections_total — «M dan N bo‘lim» (faqat bo‘limlar), employees_count — roldagi xodimlar (o‘chirilganlar ham), is_super_admin — «Super-admin» roli.
/admin/system/roleSarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
So‘rov parametrlari
| Parametr | Tavsif |
|---|---|
filter[id] | ID — aniq qiymat |
filter[creator_id] | Yaratuvchi — aniq qiymat |
filter[company_id] | Kompaniya — aniq qiymat |
filter[partner_id] | Hamkor — aniq qiymat |
filter[type] | Turi — bitta qiymat yoki ro‘yxat filter[type][] |
filter[name] | Nomlanish — qator qismi bo‘yicha qidiruv |
sort[] | Saralash, - — kamayish bo‘yicha: id, -id, name, -name |
with[] | Bog‘liq ma’lumotlarni qo‘shish: creator.profile, company, partner |
page | Sahifa raqami, 1 dan |
page-size | Sahifadagi yozuvlar soni, ko‘pi bilan 20 |
GET /admin/system/role?sort[0]=idJavob · 200
Sahifalangan javob: yozuvlar data[] ichida, sahifalash links va meta da.
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
data | object[] | Ma'lumotlar |
data[].id | integer | ID |
data[].name | string | Nomlanish |
data[].description | string | Tavsif |
data[].permissions | array | Huquqlar |
data[].sections_count | integer | |
data[].sections_total | integer | |
data[].employees_count | integer | |
data[].is_super_admin | boolean | |
data[].is_assignable | boolean | |
data[].created_at | string | Yaratilgan |
data[].updated_at | string | Yangilangan |
{
"data": [
{
"id": 1,
"name": "Admin 1",
"description": "Description 1-1",
"permissions": [
"home",
"companies"
],
"sections_count": 9,
"sections_total": 9,
"employees_count": 0,
"is_super_admin": true,
"is_assignable": true,
"created_at": "2026-11-25 16:42:00",
"updated_at": "2026-11-25 16:42:00"
},
{
"id": 118,
"name": "Бухгалтер",
"description": "",
"permissions": [
"home",
"transactions"
],
"sections_count": 2,
"sections_total": 9,
"employees_count": 2,
"is_super_admin": false,
"is_assignable": true,
"created_at": "2026-11-25 16:44:56",
"updated_at": "2026-11-25 16:44:56"
}
],
"links": {
"first": "https://api.wasyt.uz/admin/system/role?page=1",
"last": "https://api.wasyt.uz/admin/system/role?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [],
"path": "https://api.wasyt.uz/admin/system/role",
"per_page": 20,
"to": 2,
"total": 2
}
}Rol kartasi
Super Admin rolini ID bo‘yicha kalitlari bilan qaytaradi.
/admin/system/role/{model}Sarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
Yo‘l parametrlari
| Parametr | Tavsif |
|---|---|
model | Yozuv ID si |
Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
data | object[] | Ma'lumotlar |
data[].key | string | Voqea |
data[].sections | object[] | |
data[].sections[].key | string | Voqea |
data[].sections[].routes | array | Bo'limlar |
data[].sections[].actions | array |
{
"data": [
{
"key": "main",
"sections": [
{
"key": "home",
"routes": [
"admin.company.overview.cards",
"admin.company.overview.partners"
],
"actions": []
}
]
},
{
"key": "wasyt",
"sections": [
{
"key": "companies",
"routes": [
"admin.company.company.index",
"admin.company.company.show"
],
"actions": [
{
"key": "companies.create",
"routes": [
"admin.company.company.create"
]
},
{
"key": "companies.toggle",
"routes": [
"admin.company.company.delete",
"admin.company.company.restore"
]
}
]
},
{
"key": "transactions",
"routes": [
"admin.company.transaction.index",
"admin.company.transaction.show"
],
"actions": [
{
"key": "transactions.cancel",
"routes": [
"admin.company.transaction.cancel",
"admin.company.transaction.document"
]
}
]
}
]
}
]
}Rol yaratish
name majburiy, noyob, 40 belgigacha; description 100 gacha; permissions — katalog kalitlari. Amal o‘z bo‘limini o‘zi yoqadi. O‘zingizda yo‘q huquqni berib bo‘lmaydi (422).
/admin/system/roleSarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
So‘rov tanasi
| Maydon | Turi | Majburiy | Tavsif |
|---|---|---|---|
name | string | Ha | Nomlanish. Maks. 40 belgi |
description | string | Yo‘q | Tavsif. Maks. 100 belgi |
permissions | array | Yo‘q | Huquqlar |
permissions[] | string | Ha | Huquqlar. Maks. 100 belgi. Takrorlanmasin |
{
"name": "Менеджер по продажам",
"description": "Компании и демо доступ",
"permissions": [
"home",
"companies.mask",
"demo"
]
}curl -X POST "https://api.wasyt.uz/admin/system/role" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"name":"Менеджер по продажам","description":"Компании и демо доступ","permissions":["home","companies.mask","demo"]}'Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
id | integer | ID |
name | string | Nomlanish |
description | string | Tavsif |
permissions | array | Huquqlar |
sections_count | integer | |
sections_total | integer | |
employees_count | integer | |
is_super_admin | boolean | |
is_assignable | boolean | |
created_at | string | Yaratilgan |
updated_at | string | Yangilangan |
{
"id": 104,
"name": "Менеджер по продажам",
"description": "Компании и демо доступ",
"permissions": [
"home",
"companies"
],
"sections_count": 3,
"sections_total": 9,
"employees_count": 0,
"is_super_admin": false,
"is_assignable": true,
"created_at": "2026-11-25 16:44:55",
"updated_at": "2026-11-25 16:44:55"
}Xato misoli · 422
{
"message": "Количество символов в поле Описание не может превышать 100.",
"errors": {
"description": [
"Количество символов в поле Описание не может превышать 100."
]
}
}Rolni saqlash
Yaratish kabi; huquqlar roldagi barcha xodimlarda darhol amal qiladi. «Super-admin», o‘z roli va o‘zinikidan boy rolni o‘zgartirib bo‘lmaydi (400).
/admin/system/role/{model}Formadan (
multipart/form-data)PUTmetodiPOST+?_method=PUTparametri bilan yuboriladi.
Sarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
Yo‘l parametrlari
| Parametr | Tavsif |
|---|---|
model | Yozuv ID si |
So‘rov tanasi
| Maydon | Turi | Majburiy | Tavsif |
|---|---|---|---|
name | string | Ha | Nomlanish. Maks. 40 belgi |
description | string | Yo‘q | Tavsif. Maks. 100 belgi |
permissions | array | Yo‘q | Huquqlar |
permissions[] | string | Ha | Huquqlar. Maks. 100 belgi. Takrorlanmasin |
{
"name": "Главный бухгалтер",
"description": "Транзакции",
"permissions": [
"transactions",
"transactions.cancel"
]
}curl -X PUT "https://api.wasyt.uz/admin/system/role/119" \
-H "Accept: application/json" \
-H "Accept-Language: ru" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"name":"Главный бухгалтер","description":"Транзакции","permissions":["transactions","transactions.cancel"]}'Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
id | integer | ID |
name | string | Nomlanish |
description | string | Tavsif |
permissions | array | Huquqlar |
sections_count | integer | |
sections_total | integer | |
employees_count | integer | |
is_super_admin | boolean | |
is_assignable | boolean | |
created_at | string | Yaratilgan |
updated_at | string | Yangilangan |
{
"id": 119,
"name": "Главный бухгалтер",
"description": "Транзакции",
"permissions": [
"transactions",
"transactions.cancel"
],
"sections_count": 1,
"sections_total": 9,
"employees_count": 0,
"is_super_admin": false,
"is_assignable": true,
"created_at": "2026-11-25 16:44:56",
"updated_at": "2026-11-25 16:44:56"
}Rolni o‘chirish
Xodimsiz rolni o‘chiradi; aks holda 400 «Avval xodimlarni boshqa rolga o‘tkazing». «Super-admin» o‘chirilmaydi.
/admin/system/role/{model}Formadan (
multipart/form-data)DELETEmetodiPOST+?_method=DELETEparametri bilan yuboriladi.
Sarlavhalar (headers)
| Sarlavha | Qiymat | Tavsif |
|---|---|---|
Authorization | Bearer {token} | POST /common/auth/login dan olingan token |
Accept | application/json | Javob JSON da |
Accept-Language | ru | Xabarlar va nomlar tili: ru, uz, oz |
Yo‘l parametrlari
| Parametr | Tavsif |
|---|---|
model | Yozuv ID si |
Javob · 200
Javob maydonlari
| Maydon | Turi | Tavsif |
|---|---|---|
message | string | Xabar |
{
"message": "Success"
}
