@@ 108-113 (lines=6) @@ | ||
105 | */ |
|
106 | public function hasPermissionTo($permission, $guardName = null): bool |
|
107 | { |
|
108 | if (is_string($permission)) { |
|
109 | $permission = app(Permission::class)->findByName( |
|
110 | $permission, |
|
111 | $guardName ?? $this->getDefaultGuardName() |
|
112 | ); |
|
113 | } |
|
114 | ||
115 | if (is_int($permission)) { |
|
116 | $permission = app(Permission::class)->findById($permission, $this->getDefaultGuardName()); |
|
@@ 187-192 (lines=6) @@ | ||
184 | */ |
|
185 | public function hasDirectPermission($permission): bool |
|
186 | { |
|
187 | if (is_string($permission)) { |
|
188 | $permission = app(Permission::class)->findByName($permission, $this->getDefaultGuardName()); |
|
189 | if (! $permission) { |
|
190 | return false; |
|
191 | } |
|
192 | } |
|
193 | ||
194 | if (is_int($permission)) { |
|
195 | $permission = app(Permission::class)->findById($permission, $this->getDefaultGuardName()); |