diff --git a/app/Http/Controllers/SystemController.php b/app/Http/Controllers/SystemController.php index 2642ad5..b29c929 100644 --- a/app/Http/Controllers/SystemController.php +++ b/app/Http/Controllers/SystemController.php @@ -584,8 +584,14 @@ class SystemController extends Controller return redirect()->back()->with('success','Echoareas updated'); } + // @todo Allow a NC/RC/ZC to override $eo = Echoarea::active() ->where('domain_id',$ao->zone->domain_id) + ->where(function($query) use ($ao) { + return $query + ->whereRaw(sprintf('(security&7) <= %d',$ao->security)) // write + ->orWhereRaw(sprintf('((security>>3)&7) <= %d',$ao->security)); // read + }) ->orderBy('name') ->get(); @@ -618,8 +624,14 @@ class SystemController extends Controller return redirect()->back()->with('success','Fileareas updated'); } + // @todo Allow a NC/RC/ZC to override $fo = Filearea::active() ->where('domain_id',$ao->zone->domain_id) + ->where(function($query) use ($ao) { + return $query + ->whereRaw(sprintf('(security&7) <= %d',$ao->security)) // write + ->orWhereRaw(sprintf('((security>>3)&7) <= %d',$ao->security)); // read + }) ->orderBy('name') ->get();