Question about permission issues when removing a user from chat


Repost from Slack:

I’m just having some more permission issues when removing a user from chat. I’m calling the skygearChat.removeParticipant which is working fine and returns a success. I’m then trying to update the user_room table, setting a status id to 4, but am getting a permission issue. Can you please let me know what tables are updated when I call skygearChat.removeParticipant so I can add a CC function that updates my user_room table? Thanks

Just a bit more info…I am logged in as the room owner. I can also update the user_room table prior to the user being added to the conversation via ‘chat.addParticipantsToConversation’ but once the user has been added I am then unable to update my user_room table. Hope that makes sense

I get the feeling there are some table constraints added when a user is added to a conversation that therefore prevents me from updating my user_room table. I’m able to update the table via the database dashboard. If I knew what tables are updated when a user is removed from conversation via skygearChat.removeParticipant then I should be able to add some CC for ‘after_save’ on that table


On removeParticipant, a record in user_conversation will be deleted, in addition _role table will also be updated.

FYI, user_conversation is for saving user-specific attributes, like unread_count. _role is responsbile for permission.

If you want to update your user_room table, you can use after_save on user_conversation record.


Perfect, thanks Rick!