Reputation: 238
I'm trying to find a way to limit access to certain pages based on whether they are logged in as a keystone.js admin - is there a way to extend their existing admin auth to apply to pages outside of the admin interface?
Upvotes: 0
Views: 456
Reputation: 3218
If you're using the Yeoman generator, the User
model has an isAdmin
property. Within your Express route, you can determine if req.user
exists, then if req.user.isAdmin
is true
.
Upvotes: 2