Skip to main content

RevokeRolesFromUser

Revoke roles from an existing user within the authenticated group context.

The role revocation removes the permissions associated with that role from the user within the group hierarchy. The user will no longer be able to perform operations that require the revoked role.

Method Options​

Authorisation specification of the RevokeRolesFromUser method.

TypeMETHOD_TYPE_WRITE
Access LevelMETHOD_ACCESS_LEVEL_AUTHORISED
Roles
  • ROLE_IAM_ADMIN
  • ROLE_IAM_USER_ADMIN

Parameters​

Request and response parameter message overview:

Input: RevokeRolesFromUserRequest Message​

FieldTypeRequiredDescription
Name

string

True

Name of the user to revoke roles from in the format users/{ULIDv2}.

Roles

string[]

True

Roles to revoke from the user in the format groups/{ULIDv2}/roles/{role_id}. The role_id corresponds to a value from the meshtrade.iam.role.v1.Role enum.

Returns: User Message​

Code Examples​

Select supported SDK in the language of your choice for a full example of how to invoke the this method:

package main

import (
"context"
"log"

userv1 "github.com/meshtrade/api/go/iam/user/v1"
)

func main() {
ctx := context.Background()

// Default configuration is used and credentials come from MESH_API_CREDENTIALS
// environment variable or default discovery methods. Zero config required
// unless you want custom configuration.
service, err := userv1.NewUserService()
if err != nil {
log.Fatalf("Failed to create service: %v", err)
}
defer service.Close()

// Create request with service-specific parameters
request := &userv1.RevokeRolesFromUserRequest{
// FIXME: Populate service-specific request fields
}

// Call the RevokeRolesFromUser method
user, err := service.RevokeRolesFromUser(ctx, request)
if err != nil {
log.Fatalf("RevokeRolesFromUser failed: %v", err)
}

// FIXME: Add relevant response object usage
log.Printf("RevokeRolesFromUser successful: %+v", user)
}

Advanced Configuration​

For advanced client configuration options (custom endpoints, TLS settings, timeouts), see the SDK Configuration Guide.

Other Methods​