0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00
ghost/core/test/unit
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
..
api 🎨 change how we get and set config 2016-09-20 15:59:34 +01:00
apps/subscribers/lib 🐛 subscriber: sanitize email (#8078) 2017-03-03 15:44:07 +01:00
auth 🎨 handle case: sync email after logout (#8097) 2017-03-08 14:31:22 +00:00
config 🔥 remove imageRelPath (#7927) 2017-02-03 14:42:05 +00:00
controllers/frontend 🔥 No more availableThemes (#8085) 2017-03-02 17:53:48 +01:00
mail 🎨 Move settings cache & cleanup settings API (#8057) 2017-02-27 16:53:04 +01:00
metadata 🎨 Move settings cache & cleanup settings API (#8057) 2017-02-27 16:53:04 +01:00
middleware 🎨 Use settingsCache in theme handler (#8091) 2017-03-02 23:05:35 +01:00
models/base improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
models_plugins change default order of posts (#7096) 2016-07-15 11:04:10 +01:00
scheduling Error creation (#7477) 2016-10-06 13:27:35 +01:00
server_helpers 🔥 No more availableThemes (#8085) 2017-03-02 17:53:48 +01:00
sitemap 🎨 source out url utils from ConfigManager (#7347) 2016-09-20 15:59:34 +01:00
storage add read method to local file storage 2016-11-09 11:31:56 +01:00
utils 🎨 Collect & simplify package utils (#8080) 2017-03-01 14:09:31 +01:00
api_utils_spec.js replace auto increment id's by object id (#7495) 2016-11-17 09:09:11 +00:00
apps_filters_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
apps_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
errors_spec.js 🛠 use Ignition for logging/errors (#7869) 2017-01-23 11:04:01 +00:00
exporter_spec.js 🐛 export database read settings from database (#8103) 2017-03-08 10:26:57 +00:00
filters_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
ghost_url_spec.js 🔥 remove forceAdminSSL and urlSSL, add admin url (#7937) 2017-02-03 18:13:22 +00:00
importer_spec.js feature: upload validation middleware (#7208) 2016-08-18 20:25:51 +01:00
migration_fixture_utils_spec.js Themes API activation permissions & validation (#8104) 2017-03-13 12:44:44 +01:00
migration_spec.js Themes API activation permissions & validation (#8104) 2017-03-13 12:44:44 +01:00
permissions_spec.js 🎨 configurable logging with bunyan (#7431) 2016-10-04 16:33:43 +01:00
rss_spec.js 🎨 Move settings cache & cleanup settings API (#8057) 2017-02-27 16:53:04 +01:00
server_helpers_index_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
server_helpers_template_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
server_utils_spec.js 🎨 Collect & simplify package utils (#8080) 2017-03-01 14:09:31 +01:00
showdown_client_integrated_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
slack_spec.js 🔥 remove forceAdminSSL and urlSSL, add admin url (#7937) 2017-02-03 18:13:22 +00:00
social-urls_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
themes_spec.js 🔥 No more availableThemes (#8085) 2017-03-02 17:53:48 +01:00
utils_pipeline_spec.js Update mocha to version 3.0.2 🚀 (#7165) 2016-08-11 08:51:19 +01:00
validation_spec.js 🔥 🎨 Themes & settings misc cleanup (#8061) 2017-02-27 23:30:49 +01:00
xmlrpc_spec.js 🎨 😎 config env usages (#7929) 2017-02-03 18:25:39 +00:00