public function registerPermissions(array $abilities_permissions)
    {
        try {

            // a callback that is run before all other authorization checks
            if (isset($abilities_permissions['before'])) {
                if (is_array($abilities_permissions['before'])) {
                    $this->runGateBefore($abilities_permissions['before']);
                } else {
                    Log::alert('abilities "before" must be an array, no before policies registered!');
                }
            }

            // Register abilities and their polices
            if (isset($abilities_permissions['abilities'])) {
                if (is_array($abilities_permissions['abilities'])) {
                    $this->runGateDefine($abilities_permissions['abilities']);
                } else {
                    Log::alert('abilities must be an array, no abilities registered!');
                }
            }

            //  you may not modify the result of the authorization check from an after callback
            if (isset($abilities_permissions['after'])) {
                if (is_array($abilities_permissions['after'])) {
                    $this->runGateAfter($abilities_permissions['after']);
                } else {
                    Log::alert('abilities "after" must be an array, no "after" callbacks registered!');
                }
            }

            return true;
        } catch (Exception $e) {
            Log::alert('Could not register abilities .. '.$e);

            return false;
        }
    }