Ghost/core/server/api
Katharina Irrgang 48387e4ffd 🎨 tidy up static id (owner, internal, external) usages (#7675)
refs #7494, refs #7495 

This PR is an extracted clean up feature of #7495.
We are using everywhere static id checks (userId === 0 or userId === 1).
This PR moves the static values into the Base model.
This makes it 1. way more readable and 2. we can change the id's in a central place.

I changed the most important occurrences - no tests are touched (yet!).

The background is: when changing from auto increment id (number) to ObjectId's (string) we still need to support id 1 and 0, because Ghost relies on these two static id's.
I would like to support using both: 0/1 as string and 0/1 as number.

1 === owner/internal
0 === external

Another important change:
User Model does not longer define the contextUser method, because i couldn't find a reason?
I looked in Git history, see 6e48275160
2016-11-09 15:01:07 +00:00
..
app.js Replace memory spam prevention with brute-express (#7579) 2016-11-08 12:33:19 +01:00
authentication.js Replace memory spam prevention with brute-express (#7579) 2016-11-08 12:33:19 +01:00
clients.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
configuration.js 🎨 public client registration updates (#7690) 2016-11-08 14:21:25 +00:00
db.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
index.js 🎨 tidy up static id (owner, internal, external) usages (#7675) 2016-11-09 15:01:07 +00:00
invites.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
mail.js 🎨 replace process.env.NODE_ENV usages by config.get('env') (#7544) 2016-10-11 13:53:52 +01:00
notifications.js Error creation (#7477) 2016-10-06 13:27:35 +01: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 🎨 make settings cache available (#7692) 2016-11-08 13:37:19 +00: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 Error creation (#7477) 2016-10-06 13:27:35 +01:00
tags.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
themes.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
upload.js feature: upload validation middleware (#7208) 2016-08-18 20:25:51 +01:00
users.js 🎨 remove token logic from user model (#7622) 2016-11-07 11:18:50 +00:00
utils.js Error creation (#7477) 2016-10-06 13:27:35 +01:00