3 namespace BookStack\Auth\Permissions;
5 use BookStack\Auth\Role;
6 use BookStack\Entities\Models\Entity;
8 use Illuminate\Database\Eloquent\Relations\BelongsTo;
9 use Illuminate\Database\Eloquent\Relations\MorphOne;
11 class JointPermission extends Model
13 protected $primaryKey = null;
14 public $timestamps = false;
17 * Get the role that this points to.
19 public function role(): BelongsTo
21 return $this->belongsTo(Role::class);
25 * Get the entity this points to.
27 public function entity(): MorphOne
29 return $this->morphOne(Entity::class, 'entity');