|
@@ -38,15 +38,16 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
/// <param name="groupId">团组Id</param>
|
|
|
/// <param name="permission">操作权限 1:查看;2:新增;3:编辑;4:删除;5:下载; </param>
|
|
|
/// <returns></returns>
|
|
|
- public async Task<bool> PermissionValidationAsync(int groupId, int permission)
|
|
|
+ public async Task<bool> PermissionValidationAsync(int groupId, int userId, int permission = 1)
|
|
|
{
|
|
|
//参数验证
|
|
|
if (groupId < 1) return false;
|
|
|
+ if (userId < 1) return false;
|
|
|
var permissionIds = new List<int>() { 1, 2, 3, 4, 5 };
|
|
|
if (!permissionIds.Contains(permission)) return false;
|
|
|
|
|
|
var info = await _sqlSugar.Queryable<Grp_EnterExitCostPermission>()
|
|
|
- .Where(it => it.GroupId == groupId && it.Permission == permission)
|
|
|
+ .Where(it => it.GroupId == groupId && it.UserId == userId && it.Permission == permission)
|
|
|
.FirstAsync();
|
|
|
if (info != null) return true;
|
|
|
|