Compare commits
13 Commits
fce9832ea2
...
5034da19cd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5034da19cd | ||
|
|
3fce6ef499 | ||
| eba230723b | |||
| 69a4ad7286 | |||
| 212fe250c1 | |||
| a42a924884 | |||
| bec60cd24e | |||
| c17b5df8d0 | |||
| a9124e1a93 | |||
| f0ed430f37 | |||
| c071b7ecaf | |||
| 6ae2912a52 | |||
| c4952825fe |
@ -1,15 +1,10 @@
|
|||||||
using System;
|
namespace Marco.Pms.Model.ViewModels.Employee
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Marco.Pms.Model.ViewModels.Employee
|
|
||||||
{
|
{
|
||||||
public class EmployeeProfile
|
public class EmployeeProfile
|
||||||
{
|
{
|
||||||
public EmployeeVM EmployeeInfo { get; set; }
|
public EmployeeVM EmployeeInfo { get; set; }
|
||||||
public string[] Projects { get; set; }
|
public string[] Projects { get; set; }
|
||||||
public string[] FeaturePermissions { get; set; }
|
public string[] FeaturePermissions { get; set; }
|
||||||
|
public string[] Features { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,8 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
List<FeaturePermission> featurePermission = await _rolesHelper.GetFeaturePermissionByEmployeeID(emp.Id);
|
List<FeaturePermission> featurePermission = await _rolesHelper.GetFeaturePermissionByEmployeeID(emp.Id);
|
||||||
string[] projectsId = [];
|
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);
|
List<Project> projects = await _projectsHelper.GetAllProjectByTanentID(emp.TenantId);
|
||||||
projectsId = projects.Select(c=>c.Id.ToString()).ToArray();
|
projectsId = projects.Select(c=>c.Id.ToString()).ToArray();
|
||||||
}
|
}
|
||||||
@ -59,9 +60,11 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
{
|
{
|
||||||
EmployeeInfo = employeeVM,
|
EmployeeInfo = employeeVM,
|
||||||
Projects = projectsId,
|
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);
|
return Ok(profile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,8 +64,8 @@
|
|||||||
|
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
// "DefaultConnectionString": "Server=103.50.160.45;User ID=marcowvh_admin;Password=Marcoemp@123;Database=marcowvh_empattendanceci",
|
// "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=localhost;port=3306;User ID=root;Password=root;Database=MarcoBMS2",
|
||||||
"DefaultConnectionString": "Server=147.93.98.152;User ID=devuser;Password=AppUser@123$;Database=MarcoBMS1"
|
//"DefaultConnectionString": "Server=147.93.98.152;User ID=devuser;Password=AppUser@123$;Database=MarcoBMS1"
|
||||||
},
|
},
|
||||||
"AppSettings": {
|
"AppSettings": {
|
||||||
"WebFrontendUrl": "http://localhost:5173",
|
"WebFrontendUrl": "http://localhost:5173",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user