Advanced User Management
This commit is contained in:
@@ -76,7 +76,8 @@ namespace Step.Database.Controllers
|
||||
return new DTORoleModel()
|
||||
{
|
||||
Id = role.RoleId,
|
||||
Name = role.Name
|
||||
Name = role.Name,
|
||||
Level = role.Level
|
||||
};
|
||||
}
|
||||
|
||||
@@ -86,7 +87,7 @@ namespace Step.Database.Controllers
|
||||
public bool UserIsCmsAdmin(int machineId, int userId)
|
||||
{
|
||||
MachineUserModel user = FindByUserId(machineId, userId);
|
||||
if (user.Role.RoleId == (int)ROLE_IDS.CMS_SERVICE_ONLY)
|
||||
if (user.Role.RoleId == (int)ROLE_IDS.CMS_SERVICE || user.Role.RoleId == (int)ROLE_IDS.CMS_UT)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -108,12 +109,13 @@ namespace Step.Database.Controllers
|
||||
public List<DTORoleModel> GetRolesList()
|
||||
{
|
||||
return dbCtx
|
||||
.Roles
|
||||
.Roles.Where(X => X.Level < MIN_CMS_ROLE)
|
||||
.Select(x => new DTORoleModel()
|
||||
{
|
||||
Id = x.RoleId,
|
||||
Name = x.Name
|
||||
}).ToList();
|
||||
})
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public void UpdateUserRole(int machineId, int userId, int roleId)
|
||||
|
||||
Reference in New Issue
Block a user