Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

MM-10793: Handle the show/hide custom emojis in menu using permissions #1290

Merged
merged 1 commit into from
Jun 6, 2018

Conversation

jespino
Copy link
Member

@jespino jespino commented Jun 5, 2018

Summary

The emojis option in the menus wasn't based in permissions. This commit fix that problem.

Ticket Link

MM-10793

Checklist

  • Ran make check-style to check for style errors (required for all pull requests)
  • Ran make test to ensure unit and component tests passed

@jespino jespino added the 2: Dev Review Requires review by a core commiter label Jun 5, 2018
@jespino jespino added this to the v5.0.0 milestone Jun 5, 2018
if (haveITeamPermission(state, {team: t.id, permission: Permissions.MANAGE_EMOJIS})) {
canCreateCustomEmoji = true;
break;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😞

@@ -23,6 +25,16 @@ function mapStateToProps(state) {
const enableCommands = config.EnableCommands === 'true';
const enableOAuthServiceProvider = config.EnableOAuthServiceProvider === 'true';

let canCreateCustomEmoji = haveISystemPermission(state, {permission: Permissions.MANAGE_EMOJIS});
if (!canCreateCustomEmoji) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I saw a discussion about this, but to clarify, is it the case that if I have team-level permission to create custom emojis, I can create custom emojis anywhere, since custom emojis are system wide not team wide?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's the unfortunate case

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, It's exactly that. This is the quick solution to migrate emoji permissions to the permissions system. But the plan is to include a nullable "TeamId" field in the Custom emojis, so we'll be able to allow users to have team custom emojis and system custom emojis, and the manage_emojis permissions will behave like the other permissions.

@jespino jespino changed the base branch from master to release-5.0 June 6, 2018 08:07
@jespino jespino added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core commiter labels Jun 6, 2018
@jwilander jwilander assigned cpanato and unassigned GoldUniform Jun 6, 2018
@cpanato
Copy link
Contributor

cpanato commented Jun 6, 2018

merging to the release branch

@cpanato cpanato merged commit 725552c into mattermost:release-5.0 Jun 6, 2018
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Jun 6, 2018
cpanato added a commit that referenced this pull request Jun 7, 2018
* MM-10762: Adjusts team and channel role changes to support new permissions schemes. (#1293)

* Adds next Redux commit. (#1294)

* MM-10793: Handle the show/hide custom emojis in menu using permissions (#1290)

* fix missing users' status indicators on more DM modal (#1279)

* MM-10772 - Updating permissions changes (#1284)

* MM-10772 - Updating permissions changes

* Updating permissions stuff

* Updating button spacing

* Updating team icons

* Updating test snapshots

* Minor 5.0 Bug fixes (#1289)

* MM-10733 - Updating UI for posts

* MM-10780 - Updating emoji reaction tooltip

* MM-10713 Fixed collapsed post colour in permalink view (#1291)

* MM-10602 Removed extra space from OpenGraph preview for links without a description (#1276)

* MM-10602 Removed extra space from OpenGraph preview for links without a description

* Removed unnecessary div
cpanato added a commit that referenced this pull request Jun 8, 2018
* MM-10762: Adjusts team and channel role changes to support new permissions schemes. (#1293)

* Adds next Redux commit. (#1294)

* MM-10793: Handle the show/hide custom emojis in menu using permissions (#1290)

* fix missing users' status indicators on more DM modal (#1279)

* MM-10772 - Updating permissions changes (#1284)

* MM-10772 - Updating permissions changes

* Updating permissions stuff

* Updating button spacing

* Updating team icons

* Updating test snapshots

* Minor 5.0 Bug fixes (#1289)

* MM-10733 - Updating UI for posts

* MM-10780 - Updating emoji reaction tooltip

* MM-10713 Fixed collapsed post colour in permalink view (#1291)

* MM-10602 Removed extra space from OpenGraph preview for links without a description (#1276)

* MM-10602 Removed extra space from OpenGraph preview for links without a description

* Removed unnecessary div

* MM-10767: Sort the teams in the teams selector modal (#1299)

* translations PR 20180604 (#1286)

* Fix typo (platform --> mattermost) (#1300)

* MM-10555 Update outgoing webhook content-type help text (#1287)

* Update outgoing webhook content-type help text

* Update styling

* More text updates

* fix permission error on channel_converted event (#1301)

* Minor 5.0 bugs (#1296)

* MM-10795 - Fixing post control menu overlap

* Updaing post control hover

* MM-10798 - Fixing notification badge on t-sidebar
@jespino jespino deleted the MM-10793 branch June 11, 2018 09:17
cpanato added a commit that referenced this pull request Jun 11, 2018
* MM-10762: Adjusts team and channel role changes to support new permissions schemes. (#1293)

* Adds next Redux commit. (#1294)

* MM-10793: Handle the show/hide custom emojis in menu using permissions (#1290)

* fix missing users' status indicators on more DM modal (#1279)

* MM-10772 - Updating permissions changes (#1284)

* MM-10772 - Updating permissions changes

* Updating permissions stuff

* Updating button spacing

* Updating team icons

* Updating test snapshots

* Minor 5.0 Bug fixes (#1289)

* MM-10733 - Updating UI for posts

* MM-10780 - Updating emoji reaction tooltip

* MM-10713 Fixed collapsed post colour in permalink view (#1291)

* MM-10602 Removed extra space from OpenGraph preview for links without a description (#1276)

* MM-10602 Removed extra space from OpenGraph preview for links without a description

* Removed unnecessary div

* MM-10767: Sort the teams in the teams selector modal (#1299)

* translations PR 20180604 (#1286)

* Fix typo (platform --> mattermost) (#1300)

* MM-10555 Update outgoing webhook content-type help text (#1287)

* Update outgoing webhook content-type help text

* Update styling

* More text updates

* fix permission error on channel_converted event (#1301)

* Minor 5.0 bugs (#1296)

* MM-10795 - Fixing post control menu overlap

* Updaing post control hover

* MM-10798 - Fixing notification badge on t-sidebar

* MM-10789: propagate post channel_mentions to Markdown (#1304)

The `post.props.channel_mentions` structure sent by the server needed to
be passed to the Markdown component to allow merging with the already
known channels for linking.

* Fix color settings in the admin console and announcement setting disabling (#1309)

* Minor 5.0 Bug fixes (#1305)

* MM-10811 - Fixing overflow on long posts

* Removing overflow from post-message

* Updating thread view

* MM-10848 - Updating username line-height

* MM-10806: Fix for no search highlighting. (#1307)

* MM-10806: Fix for no search highlighting.

* MM-10806: Changes options.

* MM-10844: maximum file size is a TYPE_NUMBER (#1310)
@lindalumitchell lindalumitchell added the Tests/Done Release tests have been written label Jun 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4: Reviews Complete All reviewers have approved the pull request Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation Tests/Done Release tests have been written
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants