This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using AyaNova.Models;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
@@ -184,9 +185,18 @@ namespace AyaNova.DataList
|
||||
|
||||
|
||||
|
||||
string IAyaDataListViewServerCriteria.ListViewServerCriteria(long userId)
|
||||
string IAyaDataListViewServerCriteria.ListViewServerCriteria(User user, AyaNova.Models.AyContext ct)
|
||||
{
|
||||
return "[{\"fld\":\"metareviewuser\",\"filter\":{\"items\":[{\"op\":\"=\",\"value\":" + userId.ToString() + "}]}}]";
|
||||
var CurrentUserRoles = user.Roles;
|
||||
bool HasSupervisorRole =
|
||||
CurrentUserRoles.HasFlag(AuthorizationRoles.BizAdminFull) ||
|
||||
CurrentUserRoles.HasFlag(AuthorizationRoles.DispatchFull) ||
|
||||
CurrentUserRoles.HasFlag(AuthorizationRoles.InventoryFull) ||
|
||||
CurrentUserRoles.HasFlag(AuthorizationRoles.SalesFull) ||
|
||||
CurrentUserRoles.HasFlag(AuthorizationRoles.AccountingFull);
|
||||
if (!HasSupervisorRole)
|
||||
return "[{\"fld\":\"metareviewuser\",\"filter\":{\"items\":[{\"op\":\"=\",\"value\":" + user.Id.ToString() + "}]}}]";
|
||||
return null;
|
||||
}
|
||||
|
||||
}//eoc
|
||||
|
||||
Reference in New Issue
Block a user