Create a role

POST /api/v1/roles prm_roles_manage

اعرض الصفحة بصيغة Markdown

Creates a named permission set. A caller may only grant codes they hold themselves, so a role cannot be used to mint authority its author does not have.

The containment rule is the point of this endpoint. You cannot author a role carrying a permission you lack, and you cannot assign someone else's role that carries one either — the assign path runs the same check, because otherwise the author check would be trivially bypassed.

نظرة سريعة

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_roles_manage Manage roles & permissions
حد المعدل
t_mutate

المعاملات

المعامل الوصف
nameمطلوب body · string Unique within the tenant. Reserved names are refused.
permissions body · array Permission codes from the catalogue. Unknown codes are rejected, not dropped.

الأخطاء

الرمز متى تُرجَع
ERR_VALIDATION400 an unknown permission code, or a reserved role name
ERR_FORBIDDEN403 the role would grant a permission the caller does not hold
ERR_VALIDATION409 the role name already exists in this tenant

جرّبه على شبكتك.

50 مشترك لمدة 7 أيام، من غير ما تدفع حاجة.