Implemented echoarea/filearea security

This commit is contained in:
2023-07-29 13:17:36 +10:00
parent f1ccca25ea
commit cd140971e2
22 changed files with 548 additions and 58 deletions

View File

@@ -8,11 +8,41 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Rennokki\QueryCache\Traits\QueryCacheable;
use App\Traits\ScopeActive;
use App\Traits\{AreaSecurity,ScopeActive};
/**
* Echomail echoareas
*
* Security thoughts:
* + ZCs/RCs/NCs/HUBs carry all echos
* + echos for HUBs only (not NODES/POINTs, thus Hub/NC/RC/ZC)
* + echos for NCs only (NC/RC/ZC)
* + echos for RCs only (RC/ZC)
* YYRRRWWW
*
* Thus YY:
* + 0 - not exported
* + 1 - Sent to RCs (RW)
* + 2 - Sent to NCs as well (RW)
* + 3 - Sent to Hubs as well (RW)
*
* Thus RRR: (Read)
* + 0-7
* = 0 no read access
* = 1-7 minimum access required to perform
* Thus WWW: (Write)
* + 0-7
* = 0 no write access
* = 1-7 minimum access required to perform
*
* - If a node has 0, or an echoarea has 0, then no access to the function
* - So if node has 1, and echoarea has 2, no access to function
*
* @note change "public" to "bot posts"?
*/
class Echoarea extends Model
{
use SoftDeletes,ScopeActive,QueryCacheable;
use SoftDeletes,ScopeActive,QueryCacheable,AreaSecurity;
private const CACHE_TIME = 3600;