ข้ามไปยังเนื้อหาหลัก

สิทธิ์การใช้งาน

ผู้ใช้แต่ละคนอาจมีสิทธิ์การใช้งานหลายอย่าง คุณสามารถดูสิทธิ์การใช้งานของผู้ใช้ได้ในโปรไฟล์ของพวกเขา

สิทธิ์การใช้งาน

คุณสมบัติของสิทธิ์การใช้งาน

สิทธิ์การใช้งานมีคุณสมบัติดังต่อไปนี้:

  • เจ้าของ
  • ชื่อ
  • เวลาที่สร้าง
  • ชื่อที่แสดง
  • สถานะการเปิดใช้งาน
  • โมเดล
  • Users: An array of users belonging to this permission
  • Roles: An array of roles belonging to this permission
  • ประเภทของทรัพยากร
  • Resources: อาร์เรย์ของทรัพยากร
  • Actions: อาร์เรย์ของการกระทำ
  • ผลกระทบ

Managing Permissions via API

Permissions are managed as separate resources in Casdoor. When you retrieve a user object, the Permissions field is populated dynamically by extending the user data with information from the Permissions resource.

To assign or update permissions for users, use the Permissions API endpoints rather than the User API. You can manage permissions through:

  1. Web UI: Navigate to the Permissions management page (e.g., https://door.casdoor.com/permissions)
  2. API: Use the permission-specific endpoints documented in the Casdoor API reference

The Permission resource allows you to define permissions with specific users and roles assigned to them. When a user is added to a permission's Users array or belongs to a role in the permission's Roles array, that permission will automatically appear in the user's Permissions field when retrieving user data.