| 
									
										
										
										
											2016-05-01 00:16:06 +08:00
										 |  |  | <?php namespace BookStack; | 
					
						
							| 
									
										
										
										
											2016-04-21 04:37:57 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-02 04:20:50 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-04-21 04:37:57 +08:00
										 |  |  | class EntityPermission extends Model | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-02 04:20:50 +08:00
										 |  |  |     protected $fillable = ['role_id', 'action']; | 
					
						
							|  |  |  |     public $timestamps = false; | 
					
						
							| 
									
										
										
										
											2016-04-21 04:37:57 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							| 
									
										
										
										
											2016-05-02 04:20:50 +08:00
										 |  |  |      * Get all this restriction's attached entity. | 
					
						
							|  |  |  |      * @return \Illuminate\Database\Eloquent\Relations\MorphTo | 
					
						
							| 
									
										
										
										
											2016-04-21 04:37:57 +08:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2016-05-02 04:20:50 +08:00
										 |  |  |     public function restrictable() | 
					
						
							| 
									
										
										
										
											2016-04-21 04:37:57 +08:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2016-05-02 04:20:50 +08:00
										 |  |  |         return $this->morphTo('restrictable'); | 
					
						
							| 
									
										
										
										
											2016-04-21 04:37:57 +08:00
										 |  |  |     } | 
					
						
							|  |  |  | } |