@@ -89,9 +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()) return $this->denied; |
|
| 93 | 93 | |
| 94 | - return $this->hasModel($model, $relation) ? $this->allowed: $this->denied; |
|
| 94 | + return $this->hasModel($model, $relation) ? $this->allowed : $this->denied; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | // First we need to check restritions for given Role |
| 110 | 110 | // to detect special Location, IP, Hours conditions. |
| 111 | - if (! $this->checkRestrictions()) return $this->denied; |
|
| 111 | + if (!$this->checkRestrictions()) return $this->denied; |
|
| 112 | 112 | |
| 113 | 113 | if ($this->hasModel($model, $relation)) return $this->allowed; |
| 114 | 114 | |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | // First we need to check restritions for given Role |
| 130 | 130 | // to detect special Location, IP, Hours conditions. |
| 131 | - if (! $this->checkRestrictions()) return $this->denied; |
|
| 131 | + if (!$this->checkRestrictions()) return $this->denied; |
|
| 132 | 132 | |
| 133 | 133 | return $this->hasLevel($min) ? $this->allowed : $this->denied; |
| 134 | 134 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | // First we need to check restritions for given Role |
| 149 | 149 | // to detect special Location, IP, Hours conditions. |
| 150 | - if (! $this->checkRestrictions()) return $this->denied; |
|
| 150 | + if (!$this->checkRestrictions()) return $this->denied; |
|
| 151 | 151 | |
| 152 | 152 | return $this->isOwner($model, $foreign) ? $this->allowed : $this->denied; |
| 153 | 153 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | // First we need to check restritions for given Role |
| 169 | 169 | // to detect special Location, IP, Hours conditions. |
| 170 | - if (! $this->checkRestrictions()) return $this->denied; |
|
| 170 | + if (!$this->checkRestrictions()) return $this->denied; |
|
| 171 | 171 | |
| 172 | 172 | if ($this->isOwner($model, $foreign)) return $this->allowed; |
| 173 | 173 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | |
| 203 | 203 | // First we need to check restritions for given Role |
| 204 | 204 | // to detect special Location, IP, Hours conditions. |
| 205 | - if (! $this->checkRestrictions()) return $this->denied; |
|
| 205 | + if (!$this->checkRestrictions()) return $this->denied; |
|
| 206 | 206 | |
| 207 | 207 | return $this->isSharing($model, $modelRelation, $relation) ? |
| 208 | 208 | $this->allowed : $this->denied; |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('priv_roles', function (Blueprint $table) { |
|
| 16 | + Schema::create('priv_roles', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('name')->unique(); |
| 19 | 19 | $table->unsignedTinyInteger('level')->default(0); // Visitor,Employee,Manager,Director |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | { |
| 18 | 18 | $config = Manager::getAuthorizableMigration(); |
| 19 | 19 | |
| 20 | - Schema::create('priv_auth_role', function (Blueprint $table) use ($config) { |
|
| 20 | + Schema::create('priv_auth_role', function(Blueprint $table) use ($config) { |
|
| 21 | 21 | // Depend on Authorizable table structure |
| 22 | 22 | // package provides support for tree types |
| 23 | 23 | // of primaryKey: integer, string & uuid. |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('priv_permissions', function (Blueprint $table) { |
|
| 16 | + Schema::create('priv_permissions', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->morphs('grantable'); |
| 19 | 19 | $table->string('scope'); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); |
| 28 | 28 | |
| 29 | - $this->publishes([__DIR__ .'/../config/privileges.php' => config_path('privileges.php')], 'config'); |
|
| 29 | + $this->publishes([__DIR__.'/../config/privileges.php' => config_path('privileges.php')], 'config'); |
|
| 30 | 30 | |
| 31 | 31 | $this->publishes([__DIR__.'/../database/migrations/' => database_path('migrations')], 'migrations'); |
| 32 | 32 | } |
@@ -38,16 +38,16 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | public function register() |
| 40 | 40 | { |
| 41 | - $this->mergeConfigFrom(__DIR__ .'/../config/privileges.php', 'privileges'); |
|
| 41 | + $this->mergeConfigFrom(__DIR__.'/../config/privileges.php', 'privileges'); |
|
| 42 | 42 | |
| 43 | - $this->app->singleton('mrluke-privileges-detector', function ($app) { |
|
| 43 | + $this->app->singleton('mrluke-privileges-detector', function($app) { |
|
| 44 | 44 | |
| 45 | 45 | $manager = $app->make('mrluke-privileges-manager'); |
| 46 | 46 | |
| 47 | 47 | return new \Mrluke\Privileges\Detector($manager); |
| 48 | 48 | }); |
| 49 | 49 | |
| 50 | - $this->app->singleton('mrluke-privileges-manager', function ($app) { |
|
| 50 | + $this->app->singleton('mrluke-privileges-manager', function($app) { |
|
| 51 | 51 | |
| 52 | 52 | $schema = \Mrluke\Configuration\Schema::createFromFile( |
| 53 | 53 | __DIR__.'/../config/schema.json', |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | $general = 0; |
| 106 | - if (! $auth->relationLoaded('roles')) { |
|
| 106 | + if (!$auth->relationLoaded('roles')) { |
|
| 107 | 107 | $auth->load('roles.permissions'); |
| 108 | 108 | } |
| 109 | 109 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $restrictions = []; |
| 133 | 133 | $level = 0; |
| 134 | 134 | |
| 135 | - if (! $auth->relationLoaded('roles')) { |
|
| 135 | + if (!$auth->relationLoaded('roles')) { |
|
| 136 | 136 | $auth->load('roles.permissions'); |
| 137 | 137 | } |
| 138 | 138 | |