--minio文件权限管理和基表接口修改提交

master
程志刚 1 year ago
parent d1e152428c
commit 44cae6eb46

@ -170,7 +170,6 @@ namespace IBKLinker_Minio.Controller.MinioController
} }
#region minio权限表 #region minio权限表
/// <summary> /// <summary>
/// 添加minio权限表 /// 添加minio权限表
@ -922,6 +921,7 @@ namespace IBKLinker_Minio.Controller.MinioController
return request; return request;
} }
/// <summary> /// <summary>
/// 权限查询 /// 权限查询
/// </summary> /// </summary>
@ -930,9 +930,11 @@ namespace IBKLinker_Minio.Controller.MinioController
/// <param name="EmpowerType"></param> /// <param name="EmpowerType"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost, Route("GetEmpower")] [HttpPost, Route("GetEmpower")]
public bool GetEmpower(string UserID, string FileName, string EmpowerType) public RequestEntity GetEmpower(string UserID, string FileName, string EmpowerType)
{
RequestEntity request = new RequestEntity();
try
{ {
bool Empower=false;
//用户ID文件ID文件操作类型查看/移动) //用户ID文件ID文件操作类型查看/移动)
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db")) using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{ {
@ -950,17 +952,21 @@ namespace IBKLinker_Minio.Controller.MinioController
sql += "b." + EmpowerType + "=1"; sql += "b." + EmpowerType + "=1";
} }
List<MinioUser> dt = db.Query<MinioUser>("select a.* from minio_user a left join minio_role_permission b on a.role_id=b.id left join minio_authority c on b.limits_authority_id=c.limits_authority_id left join minio_storage_path d on c.file_id=d.pk where 1=1 " + sql + " ORDER BY a.creator_time").ToList(); request.data = db.Query<retqustUser>("select b.*d.FILE_NAME,d.FILE_PATH from minio_user a left join minio_role_permission b on a.role_id=b.id left join minio_authority c on b.limits_authority_id=c.limits_authority_id left join minio_storage_path d on c.file_id=d.pk where 1=1 " + sql + " ORDER BY a.creator_time").ToList();
if (dt.Count > 0) request.code = "0";
{
Empower = true;
} }
} }
catch (Exception)
{
request.code = "1";
//throw;
}
//通过用户ID查询用户得角色ID //通过用户ID查询用户得角色ID
//判断当前角色是否有操作权限 //判断当前角色是否有操作权限
//通过角色ID查询用户有权限得文件夹 //通过角色ID查询用户有权限得文件夹
return Empower; return request;
} }
#endregion #endregion
#region 公用方法 #region 公用方法

@ -31,8 +31,20 @@ namespace IBKLinker_Minio.Entity.MinioController
} }
public class RequstStoragePath: StoragePath public class RequstStoragePath: StoragePath
{ {
public List<StoragePath> requstStoragePaths { get; set; } public List<StoragePath> requstStoragePaths { get; set; }
} }
public class retqustUser : MinioRolePermission
{
/// <summary>
///文件名称
/// </summary>
[Persistent("FILE_NAME"), DisplayName("文件名称")]
public string FileName { get; set; }
/// <summary>
///文件路径
/// </summary>
[Persistent("FILE_PATH"), DisplayName("文件路径")]
public string FilePate { get; set; }
}
} }

Loading…
Cancel
Save