0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00
This commit is contained in:
Hannah Wolfe 2014-08-06 09:18:41 +01:00
commit 080e13f42d
3 changed files with 10 additions and 3 deletions

View file

@ -232,7 +232,10 @@ canEditAllSettings = function (settingsInfo, options) {
);
}
return canThis(options.context).edit.setting(setting.key);
return canThis(options.context).edit.setting(setting.key).catch(function () {
return when.reject(new errors.NoPermissionError('You do not have permission to edit settings.'));
});
},
checks = _.map(settingsInfo, function (settingInfo) {
var setting = settingsCache[settingInfo.key];

View file

@ -21,7 +21,7 @@ describe('Authentication API', function () {
describe('Not completed', function () {
// TODO: stub settings
beforeEach(testUtils.setup('roles', 'owner:pre', 'settings', 'perms:setting', 'perms:init'));
beforeEach(testUtils.setup('roles', 'owner:pre', 'settings', 'perms:setting', 'perms:mail', 'perms:init'));
it('should report that setup has not been completed', function (done) {
AuthAPI.isSetup().then(function (result) {

View file

@ -172,7 +172,11 @@ fixtures = {
user = DataGenerator.forKnex.createBasic(user);
user = _.extend({}, user, {'status': 'inactive'});
return knex('users').insert(user);
return knex('roles').insert(DataGenerator.forKnex.roles).then(function () {
return knex('users').insert(user);
}).then(function () {
return knex('roles_users').insert(DataGenerator.forKnex.roles_users[0]);
});
},
insertOwnerUser: function insertOwnerUser() {