]> BookStack Code Mirror - bookstack/blob - app/Auth/Permissions/JointPermission.php
Added front-end toggle and testing of inline attachments
[bookstack] / app / Auth / Permissions / JointPermission.php
1 <?php namespace BookStack\Auth\Permissions;
2
3 use BookStack\Auth\Role;
4 use BookStack\Entities\Models\Entity;
5 use BookStack\Model;
6 use Illuminate\Database\Eloquent\Relations\BelongsTo;
7 use Illuminate\Database\Eloquent\Relations\MorphOne;
8
9 class JointPermission extends Model
10 {
11     protected $primaryKey = null;
12     public $timestamps = false;
13
14     /**
15      * Get the role that this points to.
16      */
17     public function role(): BelongsTo
18     {
19         return $this->belongsTo(Role::class);
20     }
21
22     /**
23      * Get the entity this points to.
24      */
25     public function entity(): MorphOne
26     {
27         return $this->morphOne(Entity::class, 'entity');
28     }
29 }