How to revoke access to a channel for user using Admin Rest API? I am using php couchabse sdk for this work


#1

I have a workaround where I need to revoke access of a channel for a user using php sdk. I tried using Admin Rest API(user) for updating roles but it is not working. Please help me on this.

Thanks.


#2

currently PHP SDK does not allow to perform this task. Can you call this API with cURL?


#3

Yes, I am calling it using curl. When calling it using curl, I can update admin_roles and admin_channels. But when trying to update roles, it’s not working.


#4

Can you provide a simple sample with a document and all the channels, etc. defined?


#5

Below are list of channels and roles for a user.

{“name”:“M.8eaae23d-9bec-4faf-8d52-df46abbab8ff”,“admin_channels”:[“dxadmin-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff”,“hx”,“private-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff”,“test”],“all_channels”:["!",“ch-D-2df99b5e-c671-42b3-99e3-ab2e3a2df534”,“ch-D-58ec525e-5b05-4f9f-8d35-64e141d63602”,“ch-D-6c94a059-c947-4f56-b466-dd58ee9c4548”,“ch-D-aa60f366-ac92-4957-bd51-812820c314ed”,“ch-D-ba7ba720-1283-4f8d-ac30-731673c3db5e”,“ch-D-e565fd19-386c-4727-81f3-b52aaadf3a03”,“ch-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff-cx”,“ch-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff-cxp”,“ch-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff-dirocard”,“ch-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff-dx”,“ch-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff-dxareatracker”,“ch-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff-dxp”,“ch-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff-mx”,“ch-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff-nx”,“ch-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff-sdx”,“ch-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff-sos”,“ch-dx-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff”,“dxadmin-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff”,“hx”,“private-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff”,“test”],“admin_roles”:[“private-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff”,“test”,“test123”,“dxadmin-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff”,“hx”],“roles”:[“dxadmin-D-6c94a059-c947-4f56-b466-dd58ee9c4548”,“hx”,“dxadmin-D-e565fd19-386c-4727-81f3-b52aaadf3a03”,“private-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff”,“test”,“test123”,“dxadmin-D-2df99b5e-c671-42b3-99e3-ab2e3a2df534”,“dxadmin-M.8eaae23d-9bec-4faf-8d52-df46abbab8ff”,“dxadmin-D-58ec525e-5b05-4f9f-8d35-64e141d63602”,“dxadmin-D-aa60f366-ac92-4957-bd51-812820c314ed”]}

I need to remove the role “dxadmin-D-2df99b5e-c671-42b3-99e3-ab2e3a2df534” and channel “ch-D-2df99b5e-c671-42b3-99e3-ab2e3a2df534”.

I am using Admin REST API of user to update the roles and channels.

Thanks.


#6

Any update on this?

Thanks in advance.