mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-01 23:37:43 +03: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
@ -189,8 +189,10 @@ authentication = {
|
||||
if (ownerUser) {
|
||||
return dataProvider.User.setup(setupUser, _.extend(internal, {id: ownerUser.id}));
|
||||
} else {
|
||||
// TODO: needs to pass owner role when role endpoint is finished!
|
||||
return dataProvider.User.add(setupUser, internal);
|
||||
return dataProvider.Role.findOne({name: 'Owner'}).then(function (ownerRole) {
|
||||
setupUser.roles = [ownerRole.id];
|
||||
return dataProvider.User.add(setupUser, internal);
|
||||
});
|
||||
}
|
||||
}).then(function (user) {
|
||||
var userSettings = [];
|
||||
|
Loading…
Reference in New Issue
Block a user