public function addRole($role, $accessInherits = null)
{
if (is_string($role)) {
$role = new Role($role, ucwords($role) . ' Role');
}
if (!$role instanceof RoleInterface) {
throw new Exception('Role must be either an string or implement RoleInterface');
}
$this->redis->hMset('roles', [$role->getName() => $role->getDescription()]);
$this->redis->sAdd("accessList:{$role}:*:{$this->getDefaultAction()}}", "*");
if ($accessInherits) {
$this->addInherit($role->getName(), $accessInherits);
}
return true;
}