mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Add owner role to setup user
closes #3518 - added owner role to user that is added if no user is available
This commit is contained in:
parent
1b8c8c27c1
commit
766e6ff944
1 changed files with 4 additions and 2 deletions
|
@ -189,8 +189,10 @@ authentication = {
|
||||||
if (ownerUser) {
|
if (ownerUser) {
|
||||||
return dataProvider.User.setup(setupUser, _.extend(internal, {id: ownerUser.id}));
|
return dataProvider.User.setup(setupUser, _.extend(internal, {id: ownerUser.id}));
|
||||||
} else {
|
} else {
|
||||||
// TODO: needs to pass owner role when role endpoint is finished!
|
return dataProvider.Role.findOne({name: 'Owner'}).then(function (ownerRole) {
|
||||||
return dataProvider.User.add(setupUser, internal);
|
setupUser.roles = [ownerRole.id];
|
||||||
|
return dataProvider.User.add(setupUser, internal);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}).then(function (user) {
|
}).then(function (user) {
|
||||||
var userSettings = [];
|
var userSettings = [];
|
||||||
|
|
Loading…
Reference in a new issue