mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Fixed permission to only fetch for active users (#11641)
no-issue Essentially only active users should have their permissions loaded, this means that suspended or inactive users are stripped of all permissions until their status is changed.
This commit is contained in:
parent
58187175c3
commit
801608e077
1 changed files with 1 additions and 1 deletions
|
@ -5,7 +5,7 @@ var _ = require('lodash'),
|
|||
|
||||
module.exports = {
|
||||
user: function (id) {
|
||||
return models.User.findOne({id: id, status: 'all'}, {withRelated: ['permissions', 'roles', 'roles.permissions']})
|
||||
return models.User.findOne({id: id, status: 'active'}, {withRelated: ['permissions', 'roles', 'roles.permissions']})
|
||||
.then(function (foundUser) {
|
||||
// CASE: {context: {user: id}} where the id is not in our database
|
||||
if (!foundUser) {
|
||||
|
|
Loading…
Reference in a new issue