Ghost/core/server/api
Hannah Wolfe b2f1d0559b Themes API activation permissions & validation (#8104)
refs #8093

 Add activate theme permission
- add permission to activate themes
- update tests
- also: update tests for invites
TODO: change how the active theme setting is updated to reduce extra permissions

 Move theme validation to gscan
- add a new gscan validation method and use it for upload
- update activate endpoint to do validation also using gscan
- change to using SettingsModel instead of API so that we don't call validation or permissions on the settings API
- remove validation from the settings model
- remove the old validation function
- add new invalid theme message to translations & remove a bunch of theme validation related unused keys

📖  Planned changes

🚨 Tests for theme activation API endpoint
🐛 Don't allow deleting the active theme

🚫 Prevent activeTheme being set via settings API
- We want to control how this happens in future.
- We still want to store the information in settings, via the model.
- We just don't want to be able to change this info via the settings edit endpoint

🐛  Fix warnings for uploads & add for activations
- warnings for uploads were broken in f8b498d
- fix the response + adds tests to cover that warnings are correctly returned
- add the same response to activations + more tests
- activations now return a single theme object - the theme that was activated + any warnings

🎨 Improve how we generate theme API responses
- remove the requirement to pass in the active theme!
- move this to a specialist function, away from the list

🎨 Do not load gscan on boot
2017-03-13 12:44:44 +01:00
..
app.js Move activation to themes endpoint (#8093) 2017-03-08 10:46:03 +00:00
authentication.js 🎨 deny auto switch (#8086) 2017-03-02 19:50:58 +00:00
clients.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
configuration.js 🎨 Move settings cache & cleanup settings API (#8057) 2017-02-27 16:53:04 +01:00
db.js 🔥 🎨 No more updateSettingsCache (#8090) 2017-03-02 23:00:01 +01:00
index.js 🎨 optimisations for brute (#7867) 2017-01-23 22:44:39 +01:00
invites.js 🎨 add urlFor('admin') and increase usage of urlFor helper (#7935) 2017-02-02 18:51:35 +00:00
mail.js 🎨 😎 config env usages (#7929) 2017-02-03 18:25:39 +00:00
notifications.js replace auto increment id's by object id (#7495) 2016-11-17 09:09:11 +00:00
posts.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
roles.js Refactor handlePermissions 2015-08-11 16:03:57 +02:00
schedules.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
settings.js Themes API activation permissions & validation (#8104) 2017-03-13 12:44:44 +01:00
slack.js Slack integration 2016-05-08 12:49:15 +02:00
slugs.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
subscribers.js Fixed issue where all only a few subscribers where exported via CSV. (#7925) 2017-02-08 11:37:09 +01:00
tags.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
themes.js Themes API activation permissions & validation (#8104) 2017-03-13 12:44:44 +01:00
upload.js feature: upload validation middleware (#7208) 2016-08-18 20:25:51 +01:00
users.js ghost auth: sync email (#8027) 2017-02-23 18:04:24 +00:00
utils.js replace auto increment id's by object id (#7495) 2016-11-17 09:09:11 +00:00