Girija shankar
09/26/2025, 2:34 PMAsk Inkeep
09/26/2025, 2:34 PMAsk Inkeep
09/26/2025, 2:34 PMconst response = await permit.api.unassignRole(JSON.stringify(unassignedRole) ) ;
Where the unassignedRole object should contain :
{
role: "role",
tenant: "tenant",
user: "user"
}
Then assign the new role (2) :
await permit.api.assignRole({
role: "Manager",
tenant: "Marketing",
user: "user|123456789",
}) ;
(3)
For *Golang*, use (4) :
user, err := Permit.Api.Users.UnasignRole(ctx, "user-key", "role-key", "tenant-key")
For *Ruby*, you can use the unassign_role endpoint (5) :
api_instance.unassign_role(proj_id, env_id, role_assignment_remove)
To help our engineers investigate why the roles aren't updating properly:
1. Which Workspace / Project / Env are you using?
2. What calls are you performing (as SDK code or CURL) ?
3. Which PDP version are you running?
4. Could you share relevant logs from your PDP?Ask Inkeep
09/26/2025, 2:35 PMGirija shankar
09/26/2025, 2:36 PMString tenant = resolveTenant(organizationId);
UserRead user = usersApi.get(userId);
RoleAssignmentRead[] assignedRoles = usersApi.getAssignedRoles(user.key);
for (RoleAssignmentRead assignedRole : assignedRoles) {
if (tenant.equals(assignedRole.tenant)) {
roleAssignmentsApi.unassign(
new RoleAssignmentRemove(assignedRole.role, assignedRole.user)
.withTenant(tenant)
);
}
}
and then assigning the new one
String tenant = resolveTenant(organizationId);
UserRead user = usersApi.get(userId);
roleAssignmentsApi.assign(
new RoleAssignmentCreate(AccountRole.OWNER.getValue(), user.key)
.withTenant(tenant));Girija shankar
09/26/2025, 2:37 PMOr Weis
09/26/2025, 2:47 PMAsk Inkeep
09/26/2025, 2:47 PMOr Weis
09/26/2025, 2:47 PMAsk Inkeep
09/26/2025, 2:48 PMrole_assignment_create = OpenapiClient::RoleAssignmentCreate.new({role: 'role_example', tenant: 'tenant_example', user: 'user_example'})
To help our engineers investigate why roles aren't being properly updated:
1. Which Workspace / Project / Env are you using?
2. What exact SDK version and calls are you performing (please share the full code including imports) ?
3. Which PDP version are you running?
4. Could you share relevant logs from your PDP showing the unassign and assign operations?
Additionally, please verify:
• Are you checking the roles immediately after the operations, or is there a delay?
• Can you confirm the unassign operation is returning successfully (check the response status) ?
• Are there any error messages in your PDP logs during these operations?
This information will help identify if this is a timing issue, a caching problem, or a potential bug in the role assignment flow.Ask Inkeep
09/26/2025, 2:48 PMOr Weis
09/26/2025, 2:49 PMThomas
09/26/2025, 2:57 PMGirija shankar
09/26/2025, 2:57 PMGirija shankar
09/26/2025, 3:09 PMThomas
09/26/2025, 4:05 PMThomas
09/26/2025, 4:17 PMAlon Boshi
09/28/2025, 8:28 AMGirija shankar
09/29/2025, 6:12 AMGirija shankar
09/29/2025, 6:13 AMThomas
09/29/2025, 4:49 PM