1 <?php namespace BookStack\Auth\Permissions;
3 use BookStack\Auth\Role;
4 use BookStack\Entities\Models\Entity;
6 use Illuminate\Database\Eloquent\Relations\BelongsTo;
7 use Illuminate\Database\Eloquent\Relations\MorphOne;
9 class JointPermission extends Model
11 protected $primaryKey = null;
12 public $timestamps = false;
15 * Get the role that this points to.
17 public function role(): BelongsTo
19 return $this->belongsTo(Role::class);
23 * Get the entity this points to.
25 public function entity(): MorphOne
27 return $this->morphOne(Entity::class, 'entity');