Compare commits

...

15 Commits

Author SHA1 Message Date
dfa3ef0745 Merge branch 'Ashutosh_Employee_Update_Validation' of https://git.marcoaiot.com/admin/marco.pms.api into Ashutosh_Employee_Update_Validation 2025-04-02 17:54:49 +05:30
e50eedc7e6 Added validation in Employee Create and update api to check Whether this email and Id belongs to same employee 2025-04-02 17:54:38 +05:30
Pramod Mahajan
5034da19cd added condition for unique role name. 2025-04-02 16:53:35 +05:30
Pramod Mahajan
3fce6ef499 Merge branch 'Issuses' of https://git.marcoaiot.com/admin/marco.pms.api into Issuses 2025-04-02 16:53:08 +05:30
eba230723b Fixed bug about UpdatedBy 2025-04-02 16:08:02 +05:30
69a4ad7286 Fixed bug regrading passing incorrect tenantId and sending list of active and inactive employees rather than list of active or inc=active employees 2025-04-02 16:08:02 +05:30
212fe250c1 Solved time discrepancies in attendance/record 2025-04-02 16:08:01 +05:30
a42a924884 Added new validation in user login to verify if user is active or not and if user's email is confirmed or not 2025-04-02 16:06:53 +05:30
bec60cd24e Fixed bug about UpdatedBy 2025-04-02 16:06:53 +05:30
c17b5df8d0 Fixed bug regrading passing incorrect tenantId and sending list of active and inactive employees rather than list of active or inc=active employees 2025-04-02 16:06:53 +05:30
a9124e1a93 Fixed project duplicate bug appered due to absence of projectId 2025-04-02 16:06:53 +05:30
f0ed430f37 Solved time discrepancies in attendance/record 2025-04-02 16:06:53 +05:30
c071b7ecaf Added the condition to check if received token for reset password is encoded or not 2025-04-02 16:06:53 +05:30
6ae2912a52 Merge pull request 'user profile api returns duplicate FeaturePermissions. This makes permission checks impossible, as multiple permissions return the same feature ID. Instead it will return the permissionID, also now passing the list featureid's in the response' (#12) from vikas_38_featurepermission_issue into main
Reviewed-on: #12
2025-04-02 10:29:53 +00:00
c4952825fe user profile api returns duplicate FeaturePermissions. This makes permission checks impossible, as multiple permissions return the same feature ID. Instead it will return the permissionID, also now passing the list featureid's in the response 2025-04-02 15:58:48 +05:30
3 changed files with 10 additions and 12 deletions

View File

@ -1,15 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Marco.Pms.Model.ViewModels.Employee
namespace Marco.Pms.Model.ViewModels.Employee
{
public class EmployeeProfile
{
public EmployeeVM EmployeeInfo { get; set; }
public string[] Projects { get; set; }
public string[] FeaturePermissions { get; set; }
public string[] FeaturePermissions { get; set; }
public string[] Features { get; set; }
}
}

View File

@ -43,7 +43,8 @@ namespace MarcoBMS.Services.Controllers
List<FeaturePermission> featurePermission = await _rolesHelper.GetFeaturePermissionByEmployeeID(emp.Id);
string[] projectsId = [];
if (featurePermission != null && featurePermission.Exists(c => c.FeatureId.ToString() == "53176ebf-c75d-42e5-839f-4508ffac3def")) {
/* User with permission manage project can see all projects */
if (featurePermission != null && featurePermission.Exists(c => c.Id.ToString() == "172fc9b6-755b-4f62-ab26-55c34a330614")) {
List<Project> projects = await _projectsHelper.GetAllProjectByTanentID(emp.TenantId);
projectsId = projects.Select(c=>c.Id.ToString()).ToArray();
}
@ -59,9 +60,11 @@ namespace MarcoBMS.Services.Controllers
{
EmployeeInfo = employeeVM,
Projects = projectsId,
FeaturePermissions = featurePermission.Select(c => c.FeatureId.ToString()).ToArray(),
FeaturePermissions = featurePermission.Select(c => c.Id.ToString()).Distinct().ToArray(),
Features = featurePermission.Select(c => c.FeatureId.ToString()).Distinct().ToArray(),
};
return Ok(profile);
}
}

View File

@ -64,8 +64,8 @@
"ConnectionStrings": {
// "DefaultConnectionString": "Server=103.50.160.45;User ID=marcowvh_admin;Password=Marcoemp@123;Database=marcowvh_empattendanceci",
//"DefaultConnectionString": "Server=localhost;port=3333;User ID=root;Password=root;Database=MarcoBMS1",
"DefaultConnectionString": "Server=147.93.98.152;User ID=devuser;Password=AppUser@123$;Database=MarcoBMS1"
"DefaultConnectionString": "Server=localhost;port=3306;User ID=root;Password=root;Database=MarcoBMS2",
//"DefaultConnectionString": "Server=147.93.98.152;User ID=devuser;Password=AppUser@123$;Database=MarcoBMS1"
},
"AppSettings": {
"WebFrontendUrl": "http://localhost:5173",