Skip to content

Comments

Role rework#638

Merged
ChemMitch merged 35 commits intodevelopment_3.0from
role_rework
Feb 3, 2026
Merged

Role rework#638
ChemMitch merged 35 commits intodevelopment_3.0from
role_rework

Conversation

@ChemMitch
Copy link
Collaborator

@ChemMitch ChemMitch commented Oct 28, 2025

Ready to merge now

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)
@ChemMitch ChemMitch changed the title WIP Role rework Role rework Jan 23, 2026
console.log(`getActualTab looking for ${desiredFunctionality}`);

let filteredTabs = this.getFilteredTabs();
for(var t=0; t< filteredTabs.length; t++) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

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`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

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");
Copy link
Collaborator

Choose a reason for hiding this comment

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

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");
Copy link
Collaborator

Choose a reason for hiding this comment

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

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");
Copy link
Collaborator

Choose a reason for hiding this comment

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

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`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
console.log(`retrieved available roles`);

let toReturn = false;
roles.forEach(role => {
if(role.toLowerCase() === 'admin') {
console.log(`checkIfUserHasAdminRole role ${JSON.stringify(role)}`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

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}`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

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;
Copy link
Collaborator

Choose a reason for hiding this comment

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

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;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
isTesting = true;
isTesting = false;

Was is true for debugging purposes???

@ChemMitch ChemMitch merged commit 206b284 into development_3.0 Feb 3, 2026
1 check passed
@ChemMitch ChemMitch deleted the role_rework branch February 3, 2026 19:56
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