2021-06-26 15:23:15 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace BookStack\Auth\Permissions;
|
2018-09-25 11:30:50 +00:00
|
|
|
|
|
|
|
use BookStack\Model;
|
2016-04-20 20:37:57 +00:00
|
|
|
|
|
|
|
class EntityPermission extends Model
|
|
|
|
{
|
2016-05-01 20:20:50 +00:00
|
|
|
protected $fillable = ['role_id', 'action'];
|
|
|
|
public $timestamps = false;
|
2016-04-20 20:37:57 +00:00
|
|
|
|
|
|
|
/**
|
2016-05-01 20:20:50 +00:00
|
|
|
* Get all this restriction's attached entity.
|
2021-06-26 15:23:15 +00:00
|
|
|
*
|
2016-05-01 20:20:50 +00:00
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\MorphTo
|
2016-04-20 20:37:57 +00:00
|
|
|
*/
|
2016-05-01 20:20:50 +00:00
|
|
|
public function restrictable()
|
2016-04-20 20:37:57 +00:00
|
|
|
{
|
2016-05-01 20:20:50 +00:00
|
|
|
return $this->morphTo('restrictable');
|
2016-04-20 20:37:57 +00:00
|
|
|
}
|
|
|
|
}
|