@ -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,37 +930,43 @@ 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 )
{
{
bool Empower = false ;
RequestEntity request = new RequestEntity ( ) ;
//用户ID, 文件ID, 文件操作类型( 查看/移动)
try
using ( IDbContext db = ObjectContainer . GetObject < IDbContext > ( "db" ) )
{
{
string sql = string . Empty ;
//用户ID, 文件ID, 文件操作类型( 查看/移动)
if ( ! string . IsNullOrEmpty ( UserID ) )
using ( IDbContext db = ObjectContainer . GetObject < IDbContext > ( "db" ) )
{
sql + = "a.USER_ID=" + UserID ;
}
if ( ! string . IsNullOrEmpty ( FileName ) )
{
sql + = "d.File_Name='" + FileName + "'" ;
}
if ( ! string . IsNullOrEmpty ( FileName ) )
{
{
sql + = "b." + EmpowerType + "=1" ;
string sql = string . Empty ;
}
if ( ! string . IsNullOrEmpty ( UserID ) )
{
sql + = "a.USER_ID=" + UserID ;
}
if ( ! string . IsNullOrEmpty ( FileName ) )
{
sql + = "d.File_Name='" + FileName + "'" ;
}
if ( ! string . IsNullOrEmpty ( FileName ) )
{
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 公用方法