]> BookStack Code Mirror - bookstack/blob - app/Auth/Permissions/JointUserPermission.php
Added, and built perm. gen for, joint_user_permissions table
[bookstack] / app / Auth / Permissions / JointUserPermission.php
1 <?php
2
3 namespace BookStack\Auth\Permissions;
4
5 use BookStack\Entities\Models\Entity;
6 use BookStack\Model;
7 use Illuminate\Database\Eloquent\Relations\MorphOne;
8
9 /**
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.
13  *
14  * @property int $user_id
15  * @property int $entity_id
16  * @property string $entity_type
17  * @property boolean $has_permission
18  */
19 class JointUserPermission extends Model
20 {
21     protected $primaryKey = null;
22     public $timestamps = false;
23
24     /**
25      * Get the entity this points to.
26      */
27     public function entity(): MorphOne
28     {
29         return $this->morphOne(Entity::class, 'entity');
30     }
31 }