3 namespace BookStack\Permissions\Models;
5 use BookStack\App\Model;
6 use BookStack\Entities\Models\Entity;
7 use BookStack\Users\Models\Role;
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');