Skip to content
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

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

matheusbsilva137
Copy link
Member

@matheusbsilva137 matheusbsilva137 commented Dec 16, 2024

Proposed changes (including videos or screenshots)

  • Allow granting the 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 the mobile-upload-file permission can now be granted to the guest role. Example (cURL) request:

curl --request POST \
  --url http://localhost:3000/api/v1/method.call/authorization%3AaddPermissionToRole \
  --header 'Content-Type: application/json' \
  --header 'X-Auth-Token: jVrwkAmobgfne3aEdL-dJh-znNXMkhg79pEAZS2rEIg' \
  --header 'X-User-Id: rMq9ovRmZabXHW4Do' \
  --data '{"message":"{\"msg\":\"method\",\"id\":\"16\",\"method\":\"authorization:addPermissionToRole\",\"params\":[\"mobile-upload-file\",\"guest\"]}"}'

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 the mobile-upload-file permission can also be removed from the guest role. Example (cURL) request:

curl --request POST \
  --url http://localhost:3000/api/v1/method.call/authorization%3AremoveRoleFromPermission \
  --header 'Content-Type: application/json' \
  --header 'X-Auth-Token: jVrwkAmobgfne3aEdL-dJh-znNXMkhg79pEAZS2rEIg' \
  --header 'X-User-Id: rMq9ovRmZabXHW4Do' \
  --data '{"message":"{\"msg\":\"method\",\"id\":\"16\",\"method\":\"authorization:addPermissionToRole\",\"params\":[\"mobile-upload-file\",\"guest\"]}"}'

Further comments

CORE-837

@matheusbsilva137 matheusbsilva137 added this to the 7.2.0 milestone Dec 16, 2024
Copy link
Contributor

dionisio-bot bot commented Dec 16, 2024

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is targeting the wrong base branch. It should target 7.3.0, but it targets 7.2.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

Copy link

changeset-bot bot commented Dec 16, 2024

🦋 Changeset detected

Latest commit: 3a5ede9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@rocket.chat/meteor Minor
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/gazzodown Major
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts Major
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/network-broker Patch
@rocket.chat/models Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-client Major
@rocket.chat/ui-video-conf Major
@rocket.chat/ui-voip Major
@rocket.chat/web-ui-registration Major
@rocket.chat/instance-status Patch

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

Copy link
Contributor

PR Preview Action v1.4.8
🚀 Deployed preview to https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-34191/
on branch gh-pages at 2024-12-16 18:30 UTC

Copy link

codecov bot commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.79%. Comparing base (47f24c2) to head (3a5ede9).
Report is 3 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #34191   +/-   ##
========================================
  Coverage    75.79%   75.79%           
========================================
  Files          511      511           
  Lines        22132    22132           
  Branches      5394     5394           
========================================
  Hits         16775    16775           
  Misses        4709     4709           
  Partials       648      648           
Flag Coverage Δ
unit 75.79% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@scuciatto scuciatto modified the milestones: 7.2.0, 7.3.0 Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants