FEATURE #2048: prepare routes for ACL, add some more permissions

This commit is contained in:
Michal Kváček
2017-08-11 02:07:31 +02:00
parent cccdbda543
commit 335ec4a167
41 changed files with 836 additions and 489 deletions
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace App\Models\Permissions;
use Illuminate\Database\Eloquent\Model;
class Permission extends Model
{
public $timestamps = false;
protected $fillable = [
'string_id',
'parent_id',
'group',
'name',
'default'
];
protected $casts = [
'default' => 'boolean'
];
/**
* Assign observer for this model for logging
*/
protected static function boot()
{
parent::boot();
self::observe(PermissionObserver::class);
}
public function parent()
{
return $this->hasOne(Permission::class, 'parent_id');
}
public function subpermissions()
{
return $this->hasMany(Permission::class, 'parent_id');
}
}