diff --git a/HRM.DA/Service/Salary/SalaryCalculator.cs b/HRM.DA/Service/Salary/SalaryCalculator.cs index 485dcc9..f6e1934 100644 --- a/HRM.DA/Service/Salary/SalaryCalculator.cs +++ b/HRM.DA/Service/Salary/SalaryCalculator.cs @@ -109,6 +109,7 @@ namespace HRM.DA _employees = employees; _processMonth = processMonth; _euroRate = euroRate; + UpdateprocessStatus("Collecting Employee basic information...."); this.Initialize(); this.AddEmployeeToProcess(); diff --git a/HRM.UI/ClientApp/src/app/_guards/auth.guard.ts b/HRM.UI/ClientApp/src/app/_guards/auth.guard.ts index df4a884..00bc491 100644 --- a/HRM.UI/ClientApp/src/app/_guards/auth.guard.ts +++ b/HRM.UI/ClientApp/src/app/_guards/auth.guard.ts @@ -1,24 +1,173 @@ import { Injectable, EventEmitter } from '@angular/core'; -import { CanActivate, Router } from '@angular/router'; +import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router, RouterStateSnapshot, UrlTree } from '@angular/router'; +import { Observable, of } from 'rxjs'; +import { catchError, map, shareReplay } from 'rxjs/operators'; import { AuthService } from '../_services/auth/auth.service'; +import { HRMNotificationService } from '../app.notification.service'; @Injectable({ providedIn: 'root' }) -export class AuthGuard implements CanActivate { +export class AuthGuard implements CanActivate, CanActivateChild { public menuEvent: EventEmitter; - constructor(private authService: AuthService, private router: Router) { + /** + * Pages every logged-in user may open even when they are not in the user's role menu: + * the home pages that login / the dashboard redirect to, and the forced change-password + * screen (shown before the menu is loaded). Keep these normalized (lower case, no slashes). + */ + private static readonly ALWAYS_ALLOWED: string[] = [ + '', + 'landing-page', + 'ess/ess-dashboard', + 'ess/landing-page', + 'authentication/change-password', + ]; + + /** Every link that exists in the master menu (all roles), cached per login token. */ + private allMenuLinks$: Observable = null; + private allMenuLinksToken: string = null; + + constructor(private authService: AuthService, private router: Router, + private notificationService: HRMNotificationService) { this.menuEvent = new EventEmitter(); + this.authService.logout$.subscribe(() => this.onLogout()); } - canActivate(): boolean { - if (this.authService.loggedIn()) { + canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | boolean | UrlTree { + if (!this.authService.loggedIn()) { + this.router.navigate(['/login']); + return false; + } + return this.checkMenuPermission(state.url); + } + canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | boolean | UrlTree { + return this.canActivate(route, state); + } + private checkMenuPermission(url: string): Observable | boolean | UrlTree { + debugger; + const target = AuthGuard.normalize(url); + if (AuthGuard.ALWAYS_ALLOWED.indexOf(target) >= 0) { return true; } - // this.alertify.error('You shall not pass!!!'); - this.router.navigate(['/login']); -// this.router.navigate(['']); - return false; + + const userLinks = this.collectLinks(this.getMenuList()); + if (userLinks.some(l => AuthGuard.covers(l, target))) { + return true; + } + + // The app uses HashLocationStrategy (#/...): editing / pasting a URL in the address bar + // does NOT reload the page, it fires a 'hashchange'/'popstate' navigation. So a direct hit + // is the very first navigation OR any navigation not started by the app's own code. + const trigger = this.router.getCurrentNavigation()?.trigger; + const isDirectHit = !this.router.navigated || trigger !== 'imperative'; + if (isDirectHit) { + return this.isVisitedInApp(target) ? true : this.deny(); + } + + return this.getAllMenuLinks().pipe( + map(allLinks => { + debugger; + if (allLinks !== null && allLinks.some(l => AuthGuard.covers(l, target))) { + return this.deny(); + } + // Not a menu screen (or master menu unavailable): allow and remember it. + this.rememberVisitedInApp(target); + return true; + }) + ); + } + + private deny(): UrlTree { + this.notificationService.showError('You do not have permission to access this page.'); + return this.router.createUrlTree(['/']); + } + + /** Non-menu pages this user reached through in-app navigation, per browser tab. */ + private static readonly VISITED_KEY = 'menuGuardVisited'; + + private getVisited(): { token: string, urls: string[] } { + const token = localStorage.getItem('token'); + try { + const data = JSON.parse(sessionStorage.getItem(AuthGuard.VISITED_KEY)); + if (data && data.token === token && Array.isArray(data.urls)) { + return data; + } + } catch { } + return { token: token, urls: [] }; + } + + private isVisitedInApp(target: string): boolean { + return this.getVisited().urls.indexOf(target) >= 0; + } + + private rememberVisitedInApp(target: string): void { + const data = this.getVisited(); + if (data.urls.indexOf(target) < 0) { + data.urls.push(target); + try { sessionStorage.setItem(AuthGuard.VISITED_KEY, JSON.stringify(data)); } catch { } + } + } + + private getAllMenuLinks(): Observable { + const token = localStorage.getItem('token'); + if (this.allMenuLinks$ == null || this.allMenuLinksToken !== token) { + this.allMenuLinksToken = token; + const request$ = this.authService.getMenuesFromConfig().pipe( + map((items: any[]) => this.collectLinks(items)), + catchError(() => { + // Don't keep a failed result - retry on the next navigation. + this.resetMenuCache(); + return of(null); + }), + shareReplay(1) + ); + this.allMenuLinks$ = request$; + } + return this.allMenuLinks$; + } + + private resetMenuCache(): void { + this.allMenuLinks$ = null; + this.allMenuLinksToken = null; + } + + private onLogout(): void { + this.resetMenuCache(); + sessionStorage.removeItem(AuthGuard.VISITED_KEY); + } + + /** Flattens a menu tree (menuList) or a flat RolePermission list into normalized links. */ + private collectLinks(items: any[]): string[] { + const links: string[] = []; + const walk = (nodes: any[]) => { + if (!Array.isArray(nodes)) { return; } + for (const node of nodes) { + if (node == null) { continue; } + const link = node.routerLink ?? node.link ?? node.Link; + if (typeof link === 'string') { + const normalized = AuthGuard.normalize(link); + if (normalized !== '') { // the dashboard link "/" must not cover every URL + links.push(normalized); + } + } + walk(node.items); + } + }; + walk(items); + return links; + } + + /** Lower case, decoded path without query string, fragment, matrix params or edge slashes. */ + private static normalize(url: string): string { + let path = (url || '').split('?')[0].split('#')[0]; + path = path.split('/').map(seg => seg.split(';')[0]).join('/'); + try { path = decodeURIComponent(path); } catch { } + return path.replace(/^\/+|\/+$/g, '').toLowerCase(); + } + + /** True when the menu link is the target itself or a parent path of it (segment boundary). */ + private static covers(link: string, target: string): boolean { + return target === link || target.startsWith(link + '/'); } public getMenuList(): any { @@ -39,8 +188,8 @@ export class AuthGuard implements CanActivate { if (x.label === "") { if (x.items.length > 0) { for (let i = 0; i < x.items.length; i++) { - if (x.items[i].label === "Dashboard") { - x.label = "Dashboard"; + if (x.items[i].label === "Dash-Board") { + x.label = "Dash-Board"; x.items = null; x.routerLink = "/"; break; @@ -53,7 +202,6 @@ export class AuthGuard implements CanActivate { menuKey:menu.menuCode || '', label: menu.label || '', icon: menu.icon || null, - dividerAfter: menu.dividerAfter || false, routerLink: menu.routerLink || null, items: menu.items ? this.transformMenuData(menu.items) : null })); diff --git a/HRM.UI/ClientApp/src/app/_services/auth/auth.service.ts b/HRM.UI/ClientApp/src/app/_services/auth/auth.service.ts index f2f7504..897c8d0 100644 --- a/HRM.UI/ClientApp/src/app/_services/auth/auth.service.ts +++ b/HRM.UI/ClientApp/src/app/_services/auth/auth.service.ts @@ -210,6 +210,10 @@ export class AuthService { return this.apiService.httpPost('/Authentication/saveUserRole', params); } // ---------- User Role Permission maker-checker ---------- + /** True when this session is, or is linked to, a Super User login (may send role changes). */ + CanMakeUserRoleChange() { + return this.apiService.httpGet('/Authentication/CanMakeUserRoleChange'); + } GetUserRoleState(roleType: EnumRoleType, userID?: number, employeeID?: number) { return this.apiService.httpGet('/Authentication/GetUserRoleState/' + roleType + '/' + (userID ?? 0) + '/' + (employeeID ?? 0)); diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.html b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.html index f1929f6..d551a38 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.html +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.html @@ -400,6 +400,7 @@ + @if (isSuperUser) {
@@ -412,6 +413,23 @@ + @if (roleState && roleHasPending) { +
+

Change waiting for approval. + Until another administrator approves it in Authentication > User Role Permission, the employee keeps the current roles.

+ @if (pendingRoleAddNames.length > 0) {

Will get: {{ pendingRoleAddNames.join(', ') }}

} + @if (pendingRoleRemoveNames.length > 0) {

Will lose: {{ pendingRoleRemoveNames.join(', ') }}

} +
+ } + @if (roleState && !roleState.hasLogin) { +
+

No login yet. Sending this change creates one, switched off; it can sign in, and the login details are e-mailed, only after approval.

+
+ } @else if (roleState?.loginWaiting) { +
+

The login is waiting for this change to be approved and cannot sign in yet.

+
+ }
@@ -419,12 +437,20 @@ [class]="{'text-center': true}"> + + + {{ roleStatusText(dataItem.id) }} + +
- +
@@ -456,6 +482,7 @@
+ } @if (nidPopUp||tinPopUp||dlnoPopUp||passnoPopUp||signaturePopUp) { diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.ts index 1ed5233..b632a65 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.ts @@ -11,10 +11,14 @@ import { EnumExtension, EnumGender, EnumMaritalStatus, + EnumAuthStatus, EnumRoleType, EnumStatus, - EnumSystemType + EnumSystemType, + EnumUserType } from '../../../_models/enums'; +import { JwtHelperService } from '@auth0/angular-jwt'; +import { EnumUserRoleRequestType, UserRoleChangeRequest, UserRoleState } from '../../../_models/Authentication/UserRole'; import { Grade } from '../../../_models/Basic/grade'; import { Department } from '../../../_models/Basic/department'; import { Role } from '../../../_models/Authentication/role'; @@ -115,6 +119,8 @@ export class GeneralComponent implements OnInit { designationpicker: DynamicPicker; userPassword = ''; _selectedUserRoles: number[]; + /** The employee's live Self Service roles and any change waiting for approval (maker-checker). */ + roleState: UserRoleState; _gridRoles: Role[]; _allroles: Role[]; @@ -309,6 +315,8 @@ export class GeneralComponent implements OnInit { if (this.hrEmployee.id !== undefined && this.hrEmployee.id !== 0) { this.showEmpImage(); this.userid = undefined; + this.roleState = undefined; + this._selectedUserRoles = []; var emp: SearchEmployee = new SearchEmployee(); emp.employeeID = this.employeeService.hrEmployee.id; emp.employeeNo = this.employeeService.hrEmployee.employeeNo; @@ -367,6 +375,7 @@ export class GeneralComponent implements OnInit { } ); this.setUserRoleSelectableSettings(); + this.loadCanMakeRoleChange(); this.contact = new EmpContact(); this.employeeService.Employee_Get_Completed.subscribe( @@ -439,9 +448,131 @@ export class GeneralComponent implements OnInit { this.userRoleselectableSettings = { checkboxOnly: true, mode: 'multiple', // this.mode + enabled: !this.roleLocked, }; } + /** + * The Role Permission tab is for a Super User only: a Super User session, or an Admin/ESS session of + * a person who also has a Super User login (the server decides, and allows only them too). + */ + isSuperUser = false; + + private loadCanMakeRoleChange(): void { + const token = localStorage.getItem('token'); + const user = token ? new JwtHelperService().decodeToken(token) : undefined; + if (user == undefined) { + this.isSuperUser = false; + return; + } + if (user.UserType == EnumUserType.SuperUser) { + this.isSuperUser = true; + return; + } + this.userService.CanMakeUserRoleChange().subscribe( + (resp: boolean) => { this.isSuperUser = resp === true; }, + () => { this.isSuperUser = false; } + ); + } + + get roleHasPending(): boolean { + return (this.roleState?.pending ?? []).length > 0; + } + + /** Ticks cannot change until the roles are loaded, or while a change waits for approval. */ + get roleLocked(): boolean { + return !this.roleState || this.roleHasPending; + } + + get pendingRoleAddNames(): string[] { + return (this.roleState?.pending ?? []).filter(p => p.requestType == EnumUserRoleRequestType.Add).map(p => p.roleName); + } + + get pendingRoleRemoveNames(): string[] { + return (this.roleState?.pending ?? []).filter(p => p.requestType == EnumUserRoleRequestType.Remove).map(p => p.roleName); + } + + get hasRoleDraftChanges(): boolean { + if (this.roleLocked) { + return false; + } + const live = this.roleState.liveRoleIDs ?? []; + const ticked = this._selectedUserRoles ?? []; + return ticked.some(id => !live.includes(id)) || live.some(id => !ticked.includes(id)); + } + + /** Badge of one role row, the same wording as Authentication > User Role Permission. */ + roleStatusText(roleID: number): string { + if (!this.roleState) { + return ''; + } + const live = (this.roleState.liveRoleIDs ?? []).includes(roleID); + const pending = (this.roleState.pending ?? []).find(p => p.roleID == roleID); + if (pending) { + return pending.requestType == EnumUserRoleRequestType.Remove ? 'Removal - Not Yet Approved' : 'New - Not Yet Approved'; + } + const ticked = (this._selectedUserRoles ?? []).includes(roleID); + if (!live && ticked) { + return 'To be added'; + } + if (live && !ticked) { + return 'To be removed'; + } + return live ? 'Active' : 'Not assigned'; + } + + /** Ticks show the live roles, or what is asked for while a change waits for approval. */ + private resetRoleSelection(): void { + const live = this.roleState?.liveRoleIDs ?? []; + const pending = this.roleState?.pending ?? []; + const removing = pending.filter(p => p.requestType == EnumUserRoleRequestType.Remove).map(p => p.roleID); + const adding = pending.filter(p => p.requestType == EnumUserRoleRequestType.Add).map(p => p.roleID); + this._selectedUserRoles = [...live.filter(id => !removing.includes(id)), ...adding.filter(id => !live.includes(id))]; + this.setUserRoleSelectableSettings(); + } + + /** Loads the Self Service roles that can be given and the employee's role state. */ + private loadRoleState(): void { + const employeeID = this.employeeService.hrEmployee?.id; + if (!employeeID) { + return; + } + this.roleState = undefined; + this._selectedUserRoles = []; + this.setUserRoleSelectableSettings(); + this.loadingPanel.ShowLoadingPanel = true; + this.userService.getAllRoles().subscribe( + (resp: any) => { + this._allroles = (resp ?? []).filter((r: Role) => r.roleType == EnumRoleType.Self_Service); + }, + (err: any) => { + this.loadingPanel.ShowLoadingPanel = false; + this.notificationService.showError(err?.error ?? err); + }, + () => { + this.userService.GetUserRoleState(EnumRoleType.Self_Service, undefined, employeeID).subscribe( + (state: UserRoleState) => { + this.roleState = state; + const live = state?.liveRoleIDs ?? []; + const pending = (state?.pending ?? []).map(p => p.roleID); + // Only approved roles can be given; keep any the employee has or has asked for. + this._allroles = this._allroles.filter(r => + r.roleStatus == EnumAuthStatus.Approved || r.roleStatus == EnumAuthStatus.Active + || live.includes(r.id) || pending.includes(r.id)); + this.resetRoleSelection(); + }, + (err: any) => { + this.loadingPanel.ShowLoadingPanel = false; + this.notificationService.showError(err?.error ?? err); + }, + () => { + this.loadingPanel.ShowLoadingPanel = false; + } + ); + } + ); + } + public GetSelectedEmployee(childData) { //debugger; if (childData != undefined) { @@ -771,47 +902,49 @@ export class GeneralComponent implements OnInit { public onSelectionRoleChange(event: any): void { this._selectedUserRoles = [...this._selectedUserRoles]; } + /** + * Maker side of the User Role Permission maker-checker: the ticked roles are sent for approval + * (SaveUserRoleRequest) and nothing is live until another administrator approves them in + * Authentication > User Role Permission. An employee without a login gets one, switched off. + */ public onUserRoleSave(): void { - - if (this._selectedUserRoles.length == 0) { - this.notificationService.showWarning('select a role for Acess permision.'); + if (!this.roleState) { + this.notificationService.showWarning('Roles are not loaded yet.'); + return; + } + if (this.roleHasPending) { + this.notificationService.showWarning('This employee already has a role change waiting for approval.'); + return; + } + if (!this.hasRoleDraftChanges) { + this.notificationService.showWarning('Nothing changed.'); return; } - let userRoles: UserRole[] = []; - this._selectedUserRoles.forEach(r => { - - var userRole: UserRole = new UserRole(); - if (this.userid != undefined) { - userRole.userID = this.userid; - } - userRole.payrollTypeID = this.employeeService.hrEmployee.payrollTypeID; - userRole.employeeID = this.employeeService.hrEmployee.id; - - userRole.loginIDView = this.employeeService.hrEmployee.employeeNo; - userRole.roleID = r; - - userRoles.push(userRole); - }); + const request = new UserRoleChangeRequest(); + request.roleType = EnumRoleType.Self_Service; + request.userID = this.roleState.userID; + request.employeeID = this.roleState.employeeID ?? this.employeeService.hrEmployee.id; + request.payrollTypeID = this.roleState.payrollTypeID ?? this.employeeService.hrEmployee.payrollTypeID; + request.roleIDs = this._selectedUserRoles.slice(); this.loadingPanel.ShowLoadingPanel = true; + this.userService.SaveUserRoleRequest(request).subscribe( + () => { }, + (err: any) => { + this.loadingPanel.ShowLoadingPanel = false; + this.notificationService.showError(err?.error ?? err); + }, + () => { + this.loadingPanel.ShowLoadingPanel = false; + this.notificationService.showSuccess('Sent for approval. Nothing changes until another administrator approves it.'); + this.loadRoleState(); + } + ); + } - this.userService.saveUserRole(userRoles) - .subscribe( - (resp: any) => { - }, - (err: any) => { - //ON ERROR - this.notificationService.showSuccess(err.error); - this.loadingPanel.ShowLoadingPanel = false; - }, - () => { - this.notificationService.showSuccess('Data Saved scuccessfully.'); - this.loadingPanel.ShowLoadingPanel = false; - } - ); - - + public onUserRoleReset(): void { + this.resetRoleSelection(); } generateDefaultNumber(): string { @@ -835,7 +968,7 @@ export class GeneralComponent implements OnInit { this.pickerEmployee = emp; } this.userid = undefined; - if (e.index == 2 && this.employeeService.hrEmployee.id > 0) { + if (e.index == 2 && this.employeeService.hrEmployee.id > 0 && this.isSuperUser) { this.loadingPanel.ShowLoadingPanel = true; this.loginid = this.employeeService.hrEmployee.employeeNo; this.userService.GetUserByLoingID(this.hrEmployee.employeeNo, EnumSystemType.Self_Service).subscribe( @@ -866,43 +999,7 @@ export class GeneralComponent implements OnInit { //console.log(this.employeeService.hrEmployee.birthDate.getFullYear()); } - this.userService.getAllRoles().subscribe( - (resp: any) => { - this._allroles = resp; - this._allroles = this._allroles.filter(r => r.roleType == EnumRoleType.Self_Service); - }, - (err: any) => { - this.loadingPanel.ShowLoadingPanel = false; - this.notificationService.showError(err.error); - }, - () => { - var emp: SearchEmployee[] = []; - this._selectedUserRoles = []; - var srchemp = new SearchEmployee(); - srchemp.employeeID = this.employeeService.hrEmployee.id; - emp.push(srchemp); - this.userService.GetEmpUserRole(emp).subscribe( - (resp: any) => { - debugger; - var userRoles: UserRole[] = resp; - if (userRoles != undefined && userRoles.length > 0) { - userRoles.forEach(y => { - this._selectedUserRoles.push(y.roleID); - } - ); - } - this._selectedUserRoles = [...this._selectedUserRoles]; - }, - (err: any) => { - this.loadingPanel.ShowLoadingPanel = false; - this.notificationService.showError(err.error); - }, - () => { - this.loadingPanel.ShowLoadingPanel = false; - } - ); - } - ); + this.loadRoleState(); }); } } diff --git a/HRM.UI/Controllers/Auth/AuthController.cs b/HRM.UI/Controllers/Auth/AuthController.cs index f4a7381..55a276d 100644 --- a/HRM.UI/Controllers/Auth/AuthController.cs +++ b/HRM.UI/Controllers/Auth/AuthController.cs @@ -1568,6 +1568,44 @@ namespace HRM.UI.Controllers return CanManageUserAccessType(currentUser); } + // The Super User login that makes a role change in this session: the session's own login when it + // is a super user, otherwise the super user login linked to the same employee (a super user who + // has switched to Admin or ESS, e.g. on Employee Profile > Role Permission). The change is + // recorded under that super user, so the same person cannot approve it after switching back. + // Null when the person is not a super user. + private int? UserRoleMakerID(CurrentUser currentUser) + { + if (CanManageUserRole(currentUser)) + return currentUser.UserID; + try + { + if ((currentUser.EmployeeID ?? 0) <= 0) + return null; + int superUserID = this._userService.GetUserId((int)currentUser.EmployeeID, EnumUserType.SuperUser); + return superUserID > 0 ? superUserID : (int?)null; + } + catch (Exception) + { + // A login with no linked employee. + return null; + } + } + + // Whether this session may send role changes (shows the Employee Profile > Role Permission tab). + [HttpGet("CanMakeUserRoleChange")] + public ActionResult CanMakeUserRoleChange() + { + try + { + CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User); + return Ok(UserRoleMakerID(currentUser) != null); + } + catch (Exception e) + { + return StatusCode(StatusCodes.Status500InternalServerError, e.Message); + } + } + // Admin requests are about a User-type login; Self Service requests about an employee + payroll type. private static string CheckUserRoleSubject(UserRoleSubject subject) { @@ -1593,7 +1631,7 @@ namespace HRM.UI.Controllers try { CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User); - if (!CanManageUserRole(currentUser)) + if (UserRoleMakerID(currentUser) == null) { return StatusCode(StatusCodes.Status403Forbidden, "You are not allowed to manage user roles."); } @@ -1623,7 +1661,8 @@ namespace HRM.UI.Controllers try { CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User); - if (!CanManageUserRole(currentUser)) + int? makerID = UserRoleMakerID(currentUser); + if (makerID == null) { return StatusCode(StatusCodes.Status403Forbidden, "You are not allowed to change user roles."); } @@ -1672,7 +1711,7 @@ namespace HRM.UI.Controllers } request.RoleIDs = wanted; - int changed = this._userRoleService.RequestChange(request, currentUser.UserID); + int changed = this._userRoleService.RequestChange(request, makerID.Value); if (changed == 0) { return BadRequest("Nothing changed."); diff --git a/HRM.UI/appsettings.json b/HRM.UI/appsettings.json index 620a8f4..607abe1 100644 --- a/HRM.UI/appsettings.json +++ b/HRM.UI/appsettings.json @@ -52,8 +52,8 @@ //"Default": "provider=sql;sqlSyntax=SQL;server=103.197.204.164,1718;Database=MasterProjectDB;User Id=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;", //"SqlCommandConnection": "Data Source=103.197.204.164,1718;Initial Catalog=autocrop;Persist Security Info=True; User ID=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;", // Development - "Default": "provider=sql;sqlSyntax=SQL;server=103.197.204.164,1718;Database=MasterProjectDBUATBRAC;User Id= DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;", - "SqlCommandConnection": "Data Source=103.197.204.164,1718;Initial Catalog=MasterProjectDBUATBRAC;Persist Security Info=True; User ID=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;" // Development + "Default": "provider=sql;sqlSyntax=SQL;server=103.197.204.164,1718;Database=MasterProjectDBBRAC;User Id= DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;", + "SqlCommandConnection": "Data Source=103.197.204.164,1718;Initial Catalog=MasterProjectDBBRAC;Persist Security Info=True; User ID=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;" // Development }, "Calendar": {