Merged
Conversation
that check privileges
Untested so far
dynamically obtained from the serr
got user creation/editing to use configured roles
diagnostic logs
added a method to auth.service to allow checking a set of privileges (any that match yields a true response)
privs) are invisible
iaromoskviak
requested changes
Jan 27, 2026
src/app/core/admin/user-management/user-edit-dialog/user-edit-dialog.component.ts
Outdated
Show resolved
Hide resolved
src/app/core/admin/user-management/user-edit-dialog/user-edit-dialog.component.ts
Outdated
Show resolved
Hide resolved
src/app/core/admin/user-management/user-edit-dialog/user-edit-dialog.component.ts
Outdated
Show resolved
Hide resolved
Also, removed a duplicate from config.json
iaromoskviak
requested changes
Jan 28, 2026
simplified one method
iaromoskviak
requested changes
Jan 30, 2026
| console.log(`getActualTab looking for ${desiredFunctionality}`); | ||
|
|
||
| let filteredTabs = this.getFilteredTabs(); | ||
| for(var t=0; t< filteredTabs.length; t++) { |
Collaborator
There was a problem hiding this comment.
Suggested change
| for(var t=0; t< filteredTabs.length; t++) { | |
| for(let t=0; t< filteredTabs.length; t++) { |
|
|
||
| this.activatedRoute.params.subscribe(routeParams => { | ||
| async ngOnInit() { | ||
| console.log(`in admin.component ngOnInit`); |
Collaborator
There was a problem hiding this comment.
remove
Suggested change
| console.log(`in admin.component ngOnInit`); |
| break; | ||
| case 'user': | ||
| if(!this.canManageUsers){ | ||
| console.log("user does not have privs to manage users"); |
Collaborator
There was a problem hiding this comment.
Suggested change
| console.log("user does not have privs to manage users"); | |
| this.activeTab = actualTab; break; | ||
| case 'import': | ||
| if( !this.canImportData ) { | ||
| console.log("user does not have privs to import data"); |
Collaborator
There was a problem hiding this comment.
Suggested change
| console.log("user does not have privs to import data"); | |
|
|
||
| case 'cv': | ||
| if( !this.canManageCVs ) { | ||
| console.log("user does not have privs to manage CVs"); |
Collaborator
There was a problem hiding this comment.
Suggested change
| console.log("user does not have privs to manage CVs"); | |
| this.loading = false; | ||
| this.assignableRoles = []; | ||
| this.adminService.getAllAvailableRoles().subscribe(roleNames => { | ||
| console.log(`retrieved available roles`); |
Collaborator
There was a problem hiding this comment.
Suggested change
| console.log(`retrieved available roles`); | |
| let toReturn = false; | ||
| roles.forEach(role => { | ||
| if(role.toLowerCase() === 'admin') { | ||
| console.log(`checkIfUserHasAdminRole role ${JSON.stringify(role)}`); |
Collaborator
There was a problem hiding this comment.
Suggested change
| console.log(`checkIfUserHasAdminRole role ${JSON.stringify(role)}`); | |
| } | ||
|
|
||
| private userHasRole(roleTest: string): boolean { | ||
| console.log(`in userHasRole, this.user: ${JSON.stringify(this.user)} roleTest: ${roleTest}`); |
Collaborator
There was a problem hiding this comment.
Suggested change
| console.log(`in userHasRole, this.user: ${JSON.stringify(this.user)} roleTest: ${roleTest}`); | |
|
|
||
| private userHasRole(roleTest: string): boolean { | ||
| console.log(`in userHasRole, this.user: ${JSON.stringify(this.user)} roleTest: ${roleTest}`); | ||
| if( this.user == null) return true; |
Collaborator
There was a problem hiding this comment.
Suggested change
| if( this.user == null) return true; | |
| if( this.user == null) return false; |
Should it return false???
| isAdmin: boolean; | ||
| isTesting = false; | ||
| canUpdate: boolean = false; | ||
| isTesting = true; |
Collaborator
There was a problem hiding this comment.
Suggested change
| isTesting = true; | |
| isTesting = false; |
Was is true for debugging purposes???
iaromoskviak
approved these changes
Feb 3, 2026
fixed one uninitialized variable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ready to merge now