How can i block any user in appwrite from react ?
idk exactly that you mean, maybe you can block it if you add some variable that indicate request from Your react app, and make it trigger your Special function
Have a look at this: https://appwrite.io/docs/client/account?sdk=web-default#accountUpdateStatus
i dont want to block current logged in user , i want to block user that is doing in wrong activity in my app , from my react admin panel , how we can achieve this.?
Use the server-side Users API https://appwrite.io/docs/server/users?sdk=nodejs-default#usersUpdateStatus
i mean , i am creating a app , and for content management and upload , i have created a custom admin panel in react, How will i block any user that is doing some inappropriate task , like i do from appwrite console.
so , i have to create function for that?
yep. a simple function that takes a user's id, and calls the endpoint I mentioned
Nothing too complex
yeah same with @safwan 's answer. you can use function variable 'APPWRITE_FUNCTION_USER_ID' to know user's id. And may active some trigger further information may u can check this out https://appwrite.io/docs/functions
Just a heads up, I think the APPWRITE_FUNCTION_USER_ID variable stores the ID of the user that started the execution. So if you're going to trigger this function from your admin panel, it will hold your user ID, not the user ID of the violator. Hope that makes sense 😄
oh yeah. i agree with u. it only hold User's id😅 . user's role or team feature and determine can make it easier.
Recommended threads
- CORS errors in Obsidian custom plugin
Hi, anyone here familiar with obsidian community plugins? In short: it's a local first note app which supports writing your own add-ons / plugin But I keep get...
- > AppwriteException: The requested servi...
When trying to read or write from my database I get the following error: > AppwriteException: The requested service is disabled. You can enable the service from...
- Courtesy limit reset for non-profit migr...
Hi Team! I'm the architect for a 501(c)(3) non-profit project (Aaria's Blue Elephant) and we just hit our Free plan Database Read limit (currently at 164%). Th...