public static function createGlobalPermissions($globalPermissions, $id)
    {
        $query = [];

        if ($globalPermissions) {
            // Create global permissions
            foreach ($globalPermissions as $globalPermissionKey => $globalPermissionValue){
                if($globalPermissionValue) {
                    $query[] = array(
                        'groupID' => $id,
                        'app' => 'global',
                        'key' => $globalPermissionKey,
                        'value' => true,
                        'ids' => null,
                        'hasAll' => false,
                    );
                }
            }
        }
        return $query;
    }