0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00
ghost/core/server
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
..
admin 🎨 public config endpoint (#7631) 2016-10-28 14:07:46 +01:00
api 🎨 tidy up static id (owner, internal, external) usages (#7675) 2016-11-09 15:01:07 +00:00
apps Replace memory spam prevention with brute-express (#7579) 2016-11-08 12:33:19 +01:00
auth 🎨 tidy up static id (owner, internal, external) usages (#7675) 2016-11-09 15:01:07 +00:00
blog 🎉 🎨 Remove middleware/index.js (#7548) 2016-10-13 17:24:09 +02:00
config Replace memory spam prevention with brute-express (#7579) 2016-11-08 12:33:19 +01:00
controllers/frontend 🎉 🎨 Remove middleware/index.js (#7548) 2016-10-13 17:24:09 +02:00
data 🎨 tidy up static id (owner, internal, external) usages (#7675) 2016-11-09 15:01:07 +00:00
events post-scheduling 2016-06-14 10:52:13 +02:00
helpers Use moment-timezone when using .tz() (#7653) 2016-10-31 14:44:24 +01:00
logging 🎨 logging improvements (#7597) 2016-10-25 12:17:43 +01:00
mail 🎨 change how we get and set config 2016-09-20 15:59:34 +01:00
middleware Replace memory spam prevention with brute-express (#7579) 2016-11-08 12:33:19 +01:00
models 🎨 tidy up static id (owner, internal, external) usages (#7675) 2016-11-09 15:01:07 +00:00
permissions Error creation (#7477) 2016-10-06 13:27:35 +01:00
scheduling 🎨 fetch all scheduled posts on bootstrap (#7567) 2016-10-14 13:39:10 +01:00
storage Error creation (#7477) 2016-10-06 13:27:35 +01:00
themes 🎉 🎨 Remove middleware/index.js (#7548) 2016-10-13 17:24:09 +02:00
translations 🎨 remove token logic from user model (#7622) 2016-11-07 11:18:50 +00:00
utils 🎨 remove token logic from user model (#7622) 2016-11-07 11:18:50 +00:00
views Switch to new native system font stack (#7219) 2016-08-18 20:29:46 +01:00
app.js 🎨 logging improvements (#7597) 2016-10-25 12:17:43 +01:00
errors.js 🎨 error improvements (#7600) 2016-10-21 13:10:17 +01:00
filters.js
ghost-server.js ghost startup ipc messaging (#7678) 2016-11-07 15:25:29 +01:00
i18n.js
index.js 🎨 public client registration updates (#7690) 2016-11-08 14:21:25 +00:00
overrides.js 🛠 update lodash,knex and bookshelf to latest versions 2016-09-26 10:20:55 +02:00
update-check.js Misc Middleware cleanup (#7526) 2016-10-10 21:14:32 +02:00