public function addRole($role, $inherits = null)
    {
        if (is_string($role)) {
            $name = $role;
            $role = $this->createRole($name);
        } elseif ($role instanceof RoleInterface) {
            $name = $role->getName();
        } else {
            throw new \InvalidArgumentException('Role must be a string or implement RoleInterface');
        }

        if ($inherits) {

            if (!is_array($inherits)) {
                $inherits = [$inherits];
            }

            foreach ($inherits as $inherit) {
                $role->inherit($this->getRole($inherit));
            }
        }

        $this->roles[$name] = $role;
        return $role;
    }