Change of scope of admin gives me error 403 - Permission

Hi there,

I have a group (ID: 92) with the following members:

What I want to achieve is to make user 103 a normal participant and grant admin rights to the user with ID 65.

I tried it through the API (Java backend), as well as over the API explorer of the cometchat doc site. To document my efforts, I will show the screenshots of the API explorer here:

With these settings, I get an 403 error (Permission):

{
  "error": {
    "message": "The user with UID app_system does not have enough clearance to demote the user with UID 103 to participant scope in a group with GUID 92.",
    "devMessage": "The user with UID app_system does not have permission to change participant of the user with UID 103 in the group with GUID 92.",
    "source": "chat-api",
    "code": "ERR_GROUP_NO_SCOPE_CLEARANCE"
  }
}

OK, if app_system is not capable of changing the scope, who else will be able to do it? I also tried to provide the “onBehalfOf” attribute with user 103 (admin revoking his own credentials) but that did also not work. Same error 403, different error message:

{
  "error": {
    "message": "The user with uid 103 cannot change scope yourself from the group. Please use leave group api.",
    "devMessage": "The user with uid 103 cannot change scope oneself from the group.",
    "source": "chat-api",
    "code": "ERR_GROUP_NO_SELF_ACTION"
  }
}

The mentioned “leave group” API is part of v2 and not available anymore in V3. Hence, I tested the kick-USER-API But there I get the same two error messages.

What’s the right way to assign admin status to another user?

Hi @Dr_Kurt ,

It seems you’re trying to change the scope of the owner.
Basically, the owner is the creator of the group and has the highest level of precedence in the group.
So admins won’t be able to change the scope of the owner.

However, you can update the owner of the group by referring to this API:
https://api-explorer.cometchat.com/reference/update-group
Once the owner is updated then that user can change the scope of the previous owner.

Hope this helps!

1 Like

Thank you, that did the trick!

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.