Skip to content

Conversation

@vijaykr338
Copy link

No description provided.


await user.save();

if (req.body.team_role !== undefined && process.env.ENABLE_EMAIL === "true") {
Copy link
Member

Choose a reason for hiding this comment

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

can be good to add a comment here explaining why we send an email when team role is not defined.

also will the email be sent even if some permissions are updated ?

Copy link
Author

Choose a reason for hiding this comment

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

now every superuser will receive the same email for change in permission

added a few comments

the email will be sent even if only PERMISSIONS are updated

Copy link
Member

Choose a reason for hiding this comment

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

Went through the new commit.

Contrary to your though process, looking superuser with this way will actually fetch all user since no permission criteria is given.

You should rather use the getUsersFromRoleID with role id of superuser (available as environment variable).

Copy link
Member

@dvishal485 dvishal485 left a comment

Choose a reason for hiding this comment

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

update superuser fetch logic

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.

3 participants