public static SqlWhereCollection CanRead( this SqlWhereCollection where, string idColumnBracket) { return(HasPrivilege() ? where : where .Sites_TenantId(Sessions.TenantId()) .Or(or: new SqlWhereCollection() .Add( tableName: null, raw: Def.Sql.CanReadSites) .Add( tableName: null, subLeft: CheckRecordPermission(idColumnBracket), _operator: null))); }
public static SqlWhereCollection CanRead( this SqlWhereCollection where, Context context, string idColumnBracket, bool _using = true) { return(_using && !context.HasPrivilege ? where .Sites_TenantId(context.TenantId) .Add(or: new SqlWhereCollection() .Add( tableName: null, raw: Def.Sql.CanReadSites) .Add( tableName: null, subLeft: CheckRecordPermission(idColumnBracket), _operator: null)) : where); }