0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/test/functional/routes/api
Katharina Irrgang 506a0c3e9e 🔥 Removed certain fields from public user response (#9069)
no issue 

* Comment current state of toJSON for user model

- currently the user model does not return the email if the context is app/external/public OR if there is no context object at all
- i am not 100% sure why if there is no context we should not return the email address
- i think no context means internal access
- maybe change this condition cc @ErisDS

* Extend our access rules plugin

- we already have a instance method to determine which context is used
- this relies on passing options into `.forge` - but we almost never pass the context into the forge call
  - added @TODO
- provide another static method to determine the context based on the options object passed from outside

* Use the new static function for existing code

* Add comment where the external context is used

* Remove certain fields from a public request (User model only)

* Tests: support `checkResponse` for a public request

- start with an optional option pattern
- i would love to get rid of checkResponse('user', null, null, null)
- still support old style for now
- a resoure can define the default response fields and public response fields

* Tests: adapt public api test

* Tests: adapt api user test

- use new option pattern for `checkResponse`
- eww null, null, null, null....

* Revert the usage of the access rules plugin
2017-09-28 14:00:52 +01:00
..
authentication_spec.js 🐛 Fix error message for login when password wrong (#8594) 2017-06-19 10:37:58 +02:00
configuration_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
db_spec.js Tests: Sort out usage of content folder in tests (#9034) 2017-09-21 15:05:35 +01:00
error_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
notifications_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
posts_spec.js 🎨 User is not allowed to add/modify certain fields (#9053) 2017-09-28 13:59:42 +01:00
public_api_spec.js 🔥 Removed certain fields from public user response (#9069) 2017-09-28 14:00:52 +01:00
redirects_spec.js 🐛 Fixed missing cache invalidation header when uploading redirects (#9071) 2017-09-27 18:58:33 +01:00
settings_spec.js 🎨 Enabled Unsplash by default 2017-09-20 11:44:47 +01:00
slugs_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
spam_prevention_spec.js 🐛 Fix error message for login when password wrong (#8594) 2017-06-19 10:37:58 +02:00
tags_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
themes_spec.js 🎨 gscan 1.1.0 & optimisations 2017-06-06 13:07:50 +07:00
upload_icon_spec.js 🎨 Blog icon improvements (#8260) 2017-04-11 13:40:17 +02:00
upload_spec.js 💄 🐷 Test consistency (#8199) 2017-03-21 09:24:11 +01:00
users_spec.js 🎨 User is not allowed to add/modify certain fields (#9053) 2017-09-28 13:59:42 +01:00