src/Policies/AclPolicy.php
public function defineAbilities()
    {
        $this->gate->before(function ($user, $ability) {
            if ($user->isSuperuser()) return true;
        });

        foreach ($this->getPermissions() as $permission) {
            $this->gate->define($permission->name, function ($user) use ($permission) {
                return $user->hasPermission($permission->name);
            });
        }
    }
public function defineAbilities()
    {
        $this->gate->before(function ($user, $ability) {
            if ($user->isSuperuser()) return true;
        });

        foreach ($this->getPermissions() as $permission) {
            $this->gate->define($permission->name, function ($user) use ($permission) {
                return $user->hasPermission($permission->name);
            });
        }
    }
public function defineAbilities ( ) { $ this -> gate -> before ( function ( $ user , $ ability ) { if ( $ user -> isSuperuser ( ) ) return true ; } ) ; foreach ( $ this -> getPermissions ( ) as $ permission ) { $ this -> gate -> define ( $ permission -> name , function ( $ user ) use ( $ permission ) { return $ user -> hasPermission ( $ permission -> name ) ; } ) ; } }
Defines the Abilities for the application.

@return void
Defines the Abilities for the application .