Ana içeriğe geç

Permission Güncelle

Permission bilgilerini günceller.

Endpoint

PUT /api/v1/permissions/\{id\}
PATCH /api/v1/permissions/\{id\}

Authentication

Bu endpoint authentication gerektirir.

Header: Authorization: Bearer \{token\}

Permission

  • admin.manage - Admin yönetim işlemleri
  • permissions.update - Permission güncelleme

Request

Headers

HeaderDeğerZorunlu
AuthorizationBearer \{token\}Evet
Content-Typeapplication/jsonEvet

Path Parameters

ParametreTipZorunluAçıklama
idintegerEvetPermission ID'si

Request Body

ParametreTipZorunluAçıklama
namestringHayırPermission adı (max: 191)
slugstringHayırPermission slug'ı (unique, max: 191)
is_activebooleanHayırAktif durumu

Example Request

{
"name": "İçerik Yönetimi Updated",
"is_active": false
}

Response

Success Response (200 OK)

{
"id": 10,
"name": "İçerik Yönetimi Updated",
"slug": "content.manage",
"is_active": false,
"created_at": "2025-11-20T12:00:00.000000Z",
"updated_at": "2025-11-20T12:00:00.000000Z"
}

Error Responses

403 Forbidden

{
"message": "İzin güncelleme yetkiniz yok"
}

Code Examples

cURL

curl -X PATCH https://api.example.com/api/v1/permissions/10 \
-H "Authorization: Bearer \{token\}" \
-H "Content-Type: application/json" \
-d '{
"name": "İçerik Yönetimi Updated",
"is_active": false
}'

Notes

  • PUT tüm alanları günceller, PATCH sadece gönderilen alanları günceller
  • Permission slug'ı benzersiz olmalıdır