-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Allow granting the mobile-upload-file
permission to guests
#34191
base: develop
Are you sure you want to change the base?
Conversation
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: 4fe4ee0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 35 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #34191 +/- ##
===========================================
- Coverage 75.79% 75.32% -0.48%
===========================================
Files 511 516 +5
Lines 22132 22528 +396
Branches 5394 5483 +89
===========================================
+ Hits 16775 16969 +194
- Misses 4709 4899 +190
- Partials 648 660 +12
Flags with carried forward coverage won't be shown. Click here to find out more. |
…cketChat/Rocket.Chat into feat/mobile-upload-file-guest
if (role === 'guest' && !AuthorizationUtils.hasRestrictionsToRole(role) && (await License.hasValidLicense())) { | ||
AuthorizationUtils.addRolePermissionWhiteList(role, await License.getGuestPermissions()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason EE tests were failing on CI because we didn't have any restrictions stored for the guest role (which didn't happen locally) 🤷♂️ so I went through all of the places where we populate such restrictions and couldn't find anything off, please tell me if you do
So I decided to reinforce these restrictions in the endpoint/method itself (which I believe is harmless) and create another task to identify what could be causing this issue later
Proposed changes (including videos or screenshots)
mobile-upload-file
permission to the guest role (but not make it the default behavior)Issue(s)
Steps to test or reproduce
Use the
authorization:addPermissionToRole
Meteor method to check that themobile-upload-file
permission can now be granted to the guest role. Example (cURL) request:This Meteor method should return an error (
Permission is restricted [error-action-not-allowed]
) in case an invalid permission is provided (e.g. a permission that can't be granted to the guest role -- any permission that isn't in this list:view-d-room
,view-joined-room
,view-p-room
,start-discussion
,mobile-upload-file
).Use the
authorization:removeRoleFromPermission
Meteor method to check that themobile-upload-file
permission can also be removed from the guest role. Example (cURL) request:Further comments
CORE-837