0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00
ghost/core/server/models
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
..
base 🎨 User is not allowed to add/modify certain fields (#9053) 2017-09-28 13:59:42 +01:00
plugins 🐛 Added 409 UpdateCollisionError for the editor (#8899) 2017-08-15 12:06:40 +02:00
accesstoken.js 🎨 register events in base model (#7560) 2016-10-14 13:37:01 +01:00
app-field.js
app-setting.js
app.js 🎨 register events in base model (#7560) 2016-10-14 13:37:01 +01:00
client-trusted-domain.js Add table columns for OAuth 2015-09-02 13:39:22 +01:00
client.js 🎨 😎 config env usages (#7929) 2017-02-03 18:25:39 +00:00
index.js 🎨 Separate invites from user 2016-09-26 11:08:43 +02:00
invite.js 🎨 invites roles table into a field on the invites table (#7705) 2016-11-16 09:33:44 +00:00
permission.js
post.js 🐛 Fixed author role permission to change author (#9067) 2017-09-27 13:12:53 +02:00
refreshtoken.js
role.js Support for attribute-based permissions (#9025) 2017-09-26 18:06:14 +02:00
settings.js 🎨 do not run model listeners on import (#8720) 2017-07-21 09:58:58 +01:00
subscriber.js Support for attribute-based permissions (#9025) 2017-09-26 18:06:14 +02:00
tag.js 🎨 register events in base model (#7560) 2016-10-14 13:37:01 +01:00
user.js 🔥 Removed certain fields from public user response (#9069) 2017-09-28 14:00:52 +01:00