mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-26 20:22:18 +00:00
33 lines
739 B
PHP
33 lines
739 B
PHP
<?php
|
|
|
|
namespace BookStack\Auth\Permissions;
|
|
|
|
use BookStack\Model;
|
|
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property int $role_id
|
|
* @property int $entity_id
|
|
* @property string $entity_type
|
|
* @property boolean $view
|
|
* @property boolean $create
|
|
* @property boolean $update
|
|
* @property boolean $delete
|
|
*/
|
|
class EntityPermission extends Model
|
|
{
|
|
public const PERMISSIONS = ['view', 'create', 'update', 'delete'];
|
|
|
|
protected $fillable = ['role_id', 'view', 'create', 'update', 'delete'];
|
|
public $timestamps = false;
|
|
|
|
/**
|
|
* Get this restriction's attached entity.
|
|
*/
|
|
public function restrictable(): MorphTo
|
|
{
|
|
return $this->morphTo('restrictable');
|
|
}
|
|
}
|