0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00
ghost/test/unit/data
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
..
db Updated var declarations to const/let and no lists 2020-04-29 16:51:13 +01:00
exporter 🏗 Dropped apps related tables 2021-02-03 12:20:08 +13:00
importer Refactored usage of the pre v4 "slack" setting 2021-02-15 15:25:54 +13:00
meta Updated twitter/og structured data rules 2021-02-05 18:50:11 +13:00
migrations Removed global.Promise override (#12182) 2020-11-04 10:55:47 +00:00
schema Added staff user limit 2021-03-04 16:13:04 +00:00
validation Fixed webhook model unit test 2021-03-04 10:56:58 +01:00
xml/sitemap Removed final non-destructured imports of core/server/lib/common (#11858) 2020-05-28 17:54:18 +01:00