You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// OrganizationRole contains certain metadata for a role that can be assigned to users.
2535
+
typeOrganizationRolestruct {
2536
+
IDstring`json:"id" description:"The role relation ID" example:"policy_manager"`
2537
+
Namestring`json:"name" description:"The display name for the role" example:"Policy Manager"`
2538
+
Descriptionstring`json:"description" description:"The role description" example:"Manage all policies and procedures"`
2539
+
}
2540
+
2537
2541
// RolesRequest contains roles that can be assigned to users on top of org roles
2538
2542
typeRolesRequeststruct{}
2539
2543
2540
2544
// RolesReply holds the fields that are sent on a response to the `/roles` endpoint
2541
2545
typeRolesReplystruct {
2542
2546
// Reply is the reply value.
2543
2547
rout.Reply
2544
-
// Scopes is a list of roles that can be assigned
2545
-
Roles []string`json:"roles,omitempty" description:"A map of object types to operations that can be set for an API Token"`
2548
+
// Roles is a list of organization responsibility roles that can be assigned.
2549
+
Roles []OrganizationRole`json:"roles,omitempty" description:"Organization roles and responsibilities that can be assigned"`
2546
2550
}
2547
2551
2548
-
// ExampleResponse returns an example ScopesReply for OpenAPI documentation
2552
+
// ExampleResponse returns an example RolesReply for OpenAPI documentation
2549
2553
func (r*RolesReply) ExampleResponse() any {
2550
-
returnExampleScopesReply
2554
+
returnExampleRolesReply
2551
2555
}
2552
2556
2553
2557
// Validate ensures the required fields are set on the RolesRequest
2554
-
func (r*ScopesReply) Validate() error {
2558
+
func (r*RolesRequest) Validate() error {
2555
2559
returnnil
2556
2560
}
2557
2561
@@ -2561,9 +2565,101 @@ var ExampleRolesRequest = RolesRequest{}
2561
2565
// ExampleRolesReply is an example of a successful `/roles` response for OpenAPI documentation
2562
2566
varExampleRolesReply=RolesReply{
2563
2567
Reply: rout.Reply{Success: true},
2564
-
Roles: []string{
2565
-
"compliance_manager",
2566
-
"risk_manager",
2567
-
"policy_manager",
2568
+
Roles: []OrganizationRole{
2569
+
{
2570
+
ID: "policy_manager",
2571
+
Name: "Policy Manager",
2572
+
Description: "Can manage all policies and procedures",
2573
+
},
2574
+
{
2575
+
ID: "risk_manager",
2576
+
Name: "Risk Manager",
2577
+
Description: "Can manage risks, vulnerabilities, and findings",
2578
+
},
2579
+
},
2580
+
}
2581
+
2582
+
// OrganizationRolesRequest contains functional roles that can be assigned to users or groups in addition to their base level org role such as member, admin, etc.
2583
+
typeOrganizationRolesRequeststruct {
2584
+
OrganizationIDstring`json:"organization_id,omitempty" description:"The ID of the organization to assign roles in. Defaults to the authenticated organization." example:"01J4HMNDSZCCQBTY93BF9CBF5D"`
2585
+
Rolestring`json:"role" description:"The organization responsibility role to assign" example:"policy_manager"`
2586
+
UserIDs []string`json:"user_ids,omitempty" description:"User IDs to assign the role to"`
2587
+
GroupIDs []string`json:"group_ids,omitempty" description:"Group IDs to assign the role to"`
2588
+
}
2589
+
2590
+
// OrganizationRolesReply contains the newly assigned/removed role.
2591
+
typeOrganizationRolesReplystruct {
2592
+
rout.Reply
2593
+
OrganizationIDstring`json:"organization_id" description:"The ID of the organization the role was applied to" example:"01J4HMNDSZCCQBTY93BF9CBF5D"`
0 commit comments