In that case you can use the hook filter:middleware.renderAdminHeader this is fired when we are building the admin header which includes the plugins dropdown. Inside the hook you can look at the hookDatar.req.uid to get the uid of the user making the request. Below is a sample:
myPlugin.filterMiddlewareRenderAdminHeader = async (hookData) => { console.log(hookData.req.uid, hookData.templateData.plugins); // TODO: filter plugins in `hookData.templateData.plugins` based on hookData.req.uid return hookData; }add some new attributes for the users?
-
Hi everyone, just set up my nodebb, and there are two problems I cannot fix on my own, It will be great if I can have some help here.
1 > Is there any way for me to add some new attributes for the users myself? Like, forum coin, every time a new account created, attribute forum coin=0 attach to that account.
I don't have too much experience on the web development, so my first thought was to create a new schema in the database for the user, and try to implement the new value, and make it visible on the page. But immediately I realized that the mongodb don't have a fixed schema, so apparently it is a wrong way to go to start from the database.
2> I accidentally deleted the user uid=3, is there any way for me to regain the number, 3? I created user uid=4, and tried to update the _key and uid into 3 in mongodb, but eventually the account uid=4 just disappear from the forum altogether. I know this is kind of dangerous so never mind if it's difficult.
Suggested Topics
-
current user data
Unsolved Technical Support -
-
-
-