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

Prevent departmental accounts from being added as admins #1034

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

jarellb
Copy link
Contributor

@jarellb jarellb commented Sep 25, 2024

Ticket Link

Groupings-1779

List of squashed commits

  • Moved dept acc check function to general controller

Test Checklist

  • Exhibits Clear Code Structure:
  • Project Unit Tests Passed:
  • Project Jasmine Tests Passed:
  • Executes Expected Functionality:
  • Tested For Incorrect/Unexpected Inputs:

@jarellb jarellb requested a review from JorWo September 25, 2024 01:56
Comment on lines 246 to 255
/**
* Helper - addAdmin
* Checks if the user is a departmental account
* @param {object} user - the user you are checking to see if they are a departmental account
* @returns {boolean} true if the user is a departmental account
*/
$scope.isDeptAccount = (user) => {
return (user['uid'] === user['uhUuid'] || user['uhUuid'] === "");
}

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be repeated code. Maybe move this function into general.controller.js? Then both grouping.controller.js and admin.controller.js have access to this function.

Copy link
Contributor

Choose a reason for hiding this comment

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

And since this is an arrow function, you can drop the return:

$scope.isDeptAccount = (user) => (user['uid'] === user['uhUuid'] || user['uhUuid'] === "");

Copy link
Contributor

@JorWo JorWo left a comment

Choose a reason for hiding this comment

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

Nice and clean!

@JorWo JorWo merged commit 14bcc89 into uhawaii-system-its-ti-iam:main Oct 1, 2024
14 checks passed
michho8 pushed a commit to michho8/uh-groupings-ui that referenced this pull request Nov 14, 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