메인 콘텐츠로 건너뛰기

사용자 역할

각 사용자는 여러 역할을 가질 수 있습니다. 사용자의 프로필에서 사용자에게 할당된 역할을 볼 수 있습니다.

사용자 역할

역할 속성

모든 역할에는 다음과 같은 속성이 있습니다:

  • 소유자
  • 이름
  • 생성시간
  • 표시이름
  • 활성화됨
  • 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.