2018-09-25 07:30:50 -04:00
|
|
|
<?php namespace BookStack\Auth\Permissions;
|
|
|
|
|
2018-09-25 11:58:03 -04:00
|
|
|
use BookStack\Auth\Role;
|
2020-11-21 19:17:45 -05:00
|
|
|
use BookStack\Entities\Models\Entity;
|
2018-09-25 07:30:50 -04:00
|
|
|
use BookStack\Model;
|
2020-08-04 08:02:31 -04:00
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
2016-05-01 16:20:50 -04:00
|
|
|
|
|
|
|
class JointPermission extends Model
|
|
|
|
{
|
2020-08-04 08:02:31 -04:00
|
|
|
protected $primaryKey = null;
|
2016-05-01 16:20:50 -04:00
|
|
|
public $timestamps = false;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the role that this points to.
|
|
|
|
*/
|
2020-08-04 08:02:31 -04:00
|
|
|
public function role(): BelongsTo
|
2016-05-01 16:20:50 -04:00
|
|
|
{
|
|
|
|
return $this->belongsTo(Role::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the entity this points to.
|
|
|
|
*/
|
2020-08-04 08:02:31 -04:00
|
|
|
public function entity(): MorphOne
|
2016-05-01 16:20:50 -04:00
|
|
|
{
|
|
|
|
return $this->morphOne(Entity::class, 'entity');
|
|
|
|
}
|
|
|
|
}
|