التخطي إلى المحتوى الرئيسي

أدوار المستخدم

كل مستخدم يمكن أن يمتلك أدوار متعددة. يمكنك مشاهدة الأدوار المُسندة لمستخدم في ملفه الشخصي.

أدوار المستخدم

خصائص الدور

لكل دور الخصائص التالية:

  • مالك
  • الاسم
  • وقت الإنشاء
  • اسم العرض
  • مُفعّل
  • Users: مصفوفة من المستخدمين الفرعيين التابعين لهذا الدور
  • Roles: مصفوفة من الأدوار الفرعية التابعة لهذا الدور

Managing Roles via API

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

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

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

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