Filter available echoareas/fileareas based on security
This commit is contained in:
parent
073fa466d6
commit
e611dcbe11
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user