* Add capacity `modify-group-manager`
* Check `modify-group-manager` (backend)
* Check `modify-group-manager` (frontend)
* Update tests
* Rename AdminPermissions to mjs
* Add `ol-adminCapabilities` in frontend tests
* Allow modifying group managers if `adminRolesEnabled` is false
* Add `adminPrivilegeAvailable` check
* Update: set `ol-canModify` boolean instead of `ol-adminCapabilities`
* Mock `hasAnyAccess`
* Use `hasAdminCapability` helper
* Add `ol-canModify` to types
* Remove `isAdminMiddleware` as we don't want to relax the permissions for now
* Fix: pass `res` to `hasAnyAccess` (!!)
* * Check `hasWriteAccess` (`hasAdminCapability('modify-group-manager')` or `staffAccess.groupManagement`) in the Pug file
* Fix: Check `hasWriteAccess` in the publisher and institution pug files (!)
* Revert `hasAnyAccess` changes
* Rename `ol-canModify` to `ol-hasWriteAccess` for consistency with other variables
* Remove redundant file AdminPermissions.mjs
* Update unit test
* Revert changes to UserMembershipController.test.mjs
* Rename to `requireGroupManagersWriteAccess`
GitOrigin-RevId: f3f0b1b17abd1d2f0c363688e87d9063de886e3c
* Show Recurly's line items breakdown in subscription change preview
* fix rounding, filter items that cancel each other out
GitOrigin-RevId: 0f5d71b3917ce8a52ff36608a6ec6280fe7d38ce
* Remove bootstrap-5 folder and move tokens to foundations
* Remove unused `BsStyle` and `BsSize`
* Fix the size prop of the reference search modal
GitOrigin-RevId: 566ee519c50a39dd80bda475af40383ef8154a2c
* Add capabilities `modify-group` and `modify-managed-group`
* Fix: Warning: validateDOMNesting(...): <span> cannot appear as a child of <option>
* Add `form-control` to select (fix styles)
* Check if admin can modify the group (frontend)
* Check if admin can modify the group (backend)
* Update tests
* Fix: Set `useSettingsUKAMF` state from `data?.useSettingsUKAMF`
* Add tests: Subscriptions update with adminRolesEnabled
* Use `getAdminCapabilities` helper
* Update `requireModifyGroupPermission` to array
Co-authored-by: Andrew Rumble <andrew.rumble@overleaf.com>
* Rename `canModify` to `canModifySubscription`
Co-authored-by: Andrew Rumble <andrew.rumble@overleaf.com>
* Refactor `requireModifyGroupPermission` stub
Co-authored-by: Andrew Rumble <andrew.rumble@overleaf.com>
* Test with `adminRolesEnabled` in SubscriptionDeletionTests.mjs
* Update test description with `adminRoles`
---------
Co-authored-by: Andrew Rumble <andrew.rumble@overleaf.com>
GitOrigin-RevId: 37b9a2e838fd566a33aa3a70631cebfd01b520ef
* Add capabilitiy `modify-user-name`
* Check `modify-user-name` (backend)
* Check `modify-user-name` (frontend)
* Add `isAdmin: true` in UserAdminController.test.mjs
* Disable the name inputs instead of hidding them, so admins can still see them
* Update tests
* Update services/web/modules/admin-panel/test/unit/src/UserAdminController.test.mjs
Co-authored-by: Andrew Rumble <andrew.rumble@overleaf.com>
---------
Co-authored-by: Andrew Rumble <andrew.rumble@overleaf.com>
GitOrigin-RevId: 8731a57aaea8960606ecb4ecd5094eef4fb86f89
* Create AdminCapabilities in admin-panel module
* Add `adminRolesEnabled` setting
* Use `PermissionsController.requirePermission` in admin-panel routes
* Update `adminCapabilities` to be an array
* Update frontend tests
* Rename `defaultAdminCapabilities` to `fullAdminCapabilities`
Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
* Add tests to PermissionsManagerTests.js
* Get admin roles and capabilities from the database
* Add tests to admin-panel
* Fixup PermissionsManagerTests.js without admin-panel module
* Revert "Use `PermissionsController.requirePermission` in admin-panel routes"
This reverts commit ccbf3e3e3bca9239b786c662cba2ac6bd2f4117a.
* Revert "Fixup PermissionsManagerTests.js without admin-panel module"
This reverts commit 6d7ad207bb17c5ca4c12c489d4636a02c608926d.
* Revert "Add tests to PermissionsManagerTests.js"
This reverts commit 8f9cc911750911e1c4b74b631d8c8a1b1ca86630.
* Fix tests after the reverts
* Replace capabilities to more sensible examples ('modify-user-email' and 'view-project')
* Set `adminRolesEnabled: false` for now
* Return `[]` capabilities for non-admins
* Misc: types, test description, settings ordering
* Small refactor of AdminPermissions.mjs:
Reuse code with `getMissingCapabilities`
Throw when `requiredCapabilities` is empty
* Update tests after update
* Rename `checkAdminPermissions` to `hasAdminPermissions`
* Change role permissions to array instead of object
* Remove admin capabilities when `!Settings.adminPrivilegeAvailable`
* Return `[]` if there is no user id
* Throw if `user?._id` is missing
* Update services/web/modules/admin-panel/app/src/AdminPermissions.mjs
Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
* Adjust to ForbiddenError constructor syntax
* Give empty capabilities for unknown role, update tests
---------
Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
GitOrigin-RevId: 1eec4f6a45e1cc3ae76a3a4603cec1ceba1c2322
* Add types on existing Capabilities code
* Add ts-expect-error comments
* Minor code changes to satisfy types
* Remove ts-check because of unrelated errors
* Remove some ts-expect-error comments
* Revert "Remove some ts-expect-error comments"
This reverts commit 76cc0a073710eecf4f8b88f8579405838607f4d5.
* Remove the `@ts-check`s for now
It looks like typescript is somewhat flaky. We can re-enable this later
* Remove the `@ts-expect-error`s
* Remove return type
GitOrigin-RevId: 57bbd370654592c0662047e72e61f91bf38e0949
[web] Stop sending any event when trial changes to active for Stripe subscription on `customer.subscription.updated` stripe webhook event type
GitOrigin-RevId: 11256878cd2828036aad3130a05ad36d95466199
[web] Simulate sending `payment-page-form-success` event when user successfully subscribe using Stripe
GitOrigin-RevId: 82243fc16d3410670e4e6e9c0ccd487a5f2253a3