@@ -89,7 +89,9 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | // First we need to check restritions for given Role |
| 91 | 91 | // to detect special Location, IP, Hours conditions. |
| 92 | - if (! $this->checkRestrictions()) return $this->denied; |
|
| 92 | + if (! $this->checkRestrictions()) { |
|
| 93 | + return $this->denied; |
|
| 94 | + } |
|
| 93 | 95 | |
| 94 | 96 | return $this->hasModel($model, $relation) ? $this->allowed: $this->denied; |
| 95 | 97 | } |
@@ -108,9 +110,13 @@ discard block |
||
| 108 | 110 | |
| 109 | 111 | // First we need to check restritions for given Role |
| 110 | 112 | // to detect special Location, IP, Hours conditions. |
| 111 | - if (! $this->checkRestrictions()) return $this->denied; |
|
| 113 | + if (! $this->checkRestrictions()) { |
|
| 114 | + return $this->denied; |
|
| 115 | + } |
|
| 112 | 116 | |
| 113 | - if ($this->hasModel($model, $relation)) return $this->allowed; |
|
| 117 | + if ($this->hasModel($model, $relation)) { |
|
| 118 | + return $this->allowed; |
|
| 119 | + } |
|
| 114 | 120 | |
| 115 | 121 | return $this->hasLevel($min) ? $this->allowed : $this->denied; |
| 116 | 122 | } |
@@ -128,7 +134,9 @@ discard block |
||
| 128 | 134 | |
| 129 | 135 | // First we need to check restritions for given Role |
| 130 | 136 | // to detect special Location, IP, Hours conditions. |
| 131 | - if (! $this->checkRestrictions()) return $this->denied; |
|
| 137 | + if (! $this->checkRestrictions()) { |
|
| 138 | + return $this->denied; |
|
| 139 | + } |
|
| 132 | 140 | |
| 133 | 141 | return $this->hasLevel($min) ? $this->allowed : $this->denied; |
| 134 | 142 | } |
@@ -147,7 +155,9 @@ discard block |
||
| 147 | 155 | |
| 148 | 156 | // First we need to check restritions for given Role |
| 149 | 157 | // to detect special Location, IP, Hours conditions. |
| 150 | - if (! $this->checkRestrictions()) return $this->denied; |
|
| 158 | + if (! $this->checkRestrictions()) { |
|
| 159 | + return $this->denied; |
|
| 160 | + } |
|
| 151 | 161 | |
| 152 | 162 | return $this->isOwner($model, $foreign) ? $this->allowed : $this->denied; |
| 153 | 163 | } |
@@ -167,9 +177,13 @@ discard block |
||
| 167 | 177 | |
| 168 | 178 | // First we need to check restritions for given Role |
| 169 | 179 | // to detect special Location, IP, Hours conditions. |
| 170 | - if (! $this->checkRestrictions()) return $this->denied; |
|
| 180 | + if (! $this->checkRestrictions()) { |
|
| 181 | + return $this->denied; |
|
| 182 | + } |
|
| 171 | 183 | |
| 172 | - if ($this->isOwner($model, $foreign)) return $this->allowed; |
|
| 184 | + if ($this->isOwner($model, $foreign)) { |
|
| 185 | + return $this->allowed; |
|
| 186 | + } |
|
| 173 | 187 | |
| 174 | 188 | return $this->hasLevel($min) ? $this->allowed : $this->denied; |
| 175 | 189 | } |
@@ -202,7 +216,9 @@ discard block |
||
| 202 | 216 | |
| 203 | 217 | // First we need to check restritions for given Role |
| 204 | 218 | // to detect special Location, IP, Hours conditions. |
| 205 | - if (! $this->checkRestrictions()) return $this->denied; |
|
| 219 | + if (! $this->checkRestrictions()) { |
|
| 220 | + return $this->denied; |
|
| 221 | + } |
|
| 206 | 222 | |
| 207 | 223 | return $this->isSharing($model, $modelRelation, $relation) ? |
| 208 | 224 | $this->allowed : $this->denied; |