| 
									
										
										
										
											2018-09-25 19:30:50 +08:00
										 |  |  | <?php namespace BookStack\Auth\Permissions; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-25 23:58:03 +08:00
										 |  |  | use BookStack\Auth\Role; | 
					
						
							| 
									
										
										
										
											2018-09-25 19:30:50 +08:00
										 |  |  | use BookStack\Entities\Entity; | 
					
						
							|  |  |  | use BookStack\Model; | 
					
						
							| 
									
										
										
										
											2016-05-02 04:20:50 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | class JointPermission extends Model | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     public $timestamps = false; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Get the role that this points to. | 
					
						
							|  |  |  |      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function role() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return $this->belongsTo(Role::class); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Get the entity this points to. | 
					
						
							|  |  |  |      * @return \Illuminate\Database\Eloquent\Relations\MorphOne | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function entity() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return $this->morphOne(Entity::class, 'entity'); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |