Ghost/test/unit
Hannah Wolfe e30b9735fa Added staff user limit
refs: https://github.com/TryGhost/Team/issues/510

- In the case that host config is provided, keep staff users within the limiti
- The definition of a staff user is a user with a role other than Contributor, and whose status is not inactive
   - Contributors don't count
   - Suspended (status inactive) users don't count
   - Locked users DO count
   - Invited users DO count
- You can't invite more staff users whilst there are pending invites
- You can't unsuspend a user, or change the role on a user in such a way as will take you over your limit
- You can't import staff users - all imported users are automatically set to Contributors
- As part of this work, we are changing the default Ghost user to a Contributor otherwise it uses up a staff user

Note: there is one known active bug with this commit.
- Assume you have one remaining user within your limit. You send an invite, this works.
- You cannot "resend" that invite, it will think you're sending a new invite and hit the limit
- You must "revoke" that invite first, and create a new one
- This bug exists because the resend function uses the add endpoint & does a delete+add, but this hits the permission check before the delete
2021-03-04 16:13:04 +00:00
..
adapters Fixed "no-shadow" eslint warning in tests 2020-10-19 17:45:26 +13:00
api Enabled Members for all sites (#12582) 2021-02-02 16:12:53 +00:00
apps 🔒 Fixed open redirect in private site login 2021-01-26 16:42:42 +00:00
data Added staff user limit 2021-03-04 16:13:04 +00:00
helpers Fixed accent color on pages with no context 2021-03-04 10:56:53 +00:00
lib Updated mobiledoc tests for lazy loaded images (#12672) 2021-02-18 19:49:40 +00:00
models 🐛 Added multiple use grace period to tokens (#12519) 2021-01-18 17:03:41 +00:00
server Moved notify out of GhostServer 2021-02-19 20:22:56 +00:00
services Fixed cache test suite 2021-03-04 18:35:02 +13:00
shared/config Updated tests locations and added linting of core/shared (#11872) 2020-06-01 22:06:50 +01:00
web Pointed the v3 unit tests to the actual v3 code 2021-01-22 16:32:03 +13:00