3 namespace BookStack\Auth\Permissions;
5 use BookStack\Entities\Models\Entity;
7 use Illuminate\Database\Eloquent\Relations\MorphOne;
10 * Holds the "cached" user-specific permissions for entities in the system.
11 * These only exist to indicate resolved permissions active via user-specific
12 * entity permissions, not for all permission combinations for all users.
14 * @property int $user_id
15 * @property int $entity_id
16 * @property string $entity_type
17 * @property boolean $has_permission
19 class JointUserPermission extends Model
21 protected $primaryKey = null;
22 public $timestamps = false;
25 * Get the entity this points to.
27 public function entity(): MorphOne
29 return $this->morphOne(Entity::class, 'entity');