Detect if user is admin
General
2
Posts
2
Posters
939
Views
1
Watching
-
Would you happen to know how to simply detect if a user is admin in code within custom JS CPā¦
var uid = req.user ? req.user.uid : 0; user.isAdministrator(uid, function(err, isAdmin) { });is what i have tried but things are not declaredā¦
-
Would you happen to know how to simply detect if a user is admin in code within custom JS CPā¦
var uid = req.user ? req.user.uid : 0; user.isAdministrator(uid, function(err, isAdmin) { });is what i have tried but things are not declaredā¦
@pwsincd I think you can use
userData.isAdmin = isAdmin;if Iām not mistaken - see
https://community.nodebb.org/topic/15128/how-to-hide-whitelist-user-field-only-to-owner-or-admin?_=1648802303112 for an example
Related Topics
-
Block Domain
Solved Let's Build It -
-
-
Podcast Share NodeBB
Solved Configure -
Forum Icons NodeBB
Solved Customisation -
-
Bootstrap Version
Solved Customisation -