Skip to content

Commit

Permalink
Allow user with "bulk-register-user" permission to send invitation ma…
Browse files Browse the repository at this point in the history
…ils (#12112)
  • Loading branch information
mrsimpson authored and geekgonecrazy committed Sep 25, 2018
1 parent 60a14e4 commit 82666e0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Meteor.methods({
method: 'sendInvitationEmail',
});
}
if (!RocketChat.authz.hasRole(Meteor.userId(), 'admin')) {
if (!RocketChat.authz.hasPermission(Meteor.userId(), 'bulk-register-user')) {
throw new Meteor.Error('error-not-allowed', 'Not allowed', {
method: 'sendInvitationEmail',
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template name="adminInviteUser">
{{#if isAdmin}}
{{#if isAllowed}}
<div class="content">
<div class="user-view">
<div class="about clearfix">
Expand Down
4 changes: 2 additions & 2 deletions packages/rocketchat-ui-admin/client/users/adminInviteUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import _ from 'underscore';
import toastr from 'toastr';

Template.adminInviteUser.helpers({
isAdmin() {
return RocketChat.authz.hasRole(Meteor.userId(), 'admin');
isAllowed() {
return RocketChat.authz.hasAtLeastOnePermission('bulk-register-user');
},
inviteEmails() {
return Template.instance().inviteEmails.get();
Expand Down

0 comments on commit 82666e0

Please sign in to comment.