Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Send instant message with empty repository when saving user / group r…
Browse files Browse the repository at this point in the history
…ole. We should have a similar strategy to publish a message to a role scope as well.
  • Loading branch information
cdujeu committed Sep 29, 2016
1 parent 4a2830f commit a28162f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/src/core/src/pydio/Core/Services/RolesService.php
Expand Up @@ -22,7 +22,10 @@

use Pydio\Conf\Core\AJXP_Role;
use Pydio\Conf\Core\AjxpRole;
use Pydio\Core\Controller\Controller;
use Pydio\Core\Exception\PydioException;
use Pydio\Core\Http\Message\ReloadRepoListMessage;
use Pydio\Core\Model\Context;
use Pydio\Core\Model\UserInterface;
use Pydio\Core\PluginFramework\PluginsService;

Expand Down Expand Up @@ -144,6 +147,11 @@ public static function updateRole($roleObject, $userObject = null)
ConfService::getConfStorageImpl()->updateRole($roleObject, $userObject);
CacheService::saveWithTimestamp(AJXP_CACHE_SERVICE_NS_SHARED, "pydio:role:".$roleObject->getId(), $roleObject);
ConfService::getInstance()->invalidateLoadedRepositories();
$roleId = $roleObject->getId();
if(strpos($roleId, "AJXP_GRP_/") === 0){
$groupPath = substr($roleId, strlen("AJXP_GRP_"));
Controller::applyHook("msg.instant", array(Context::contextWithObjects(null, null), ReloadRepoListMessage::XML(), null, $groupPath));
}
}

/**
Expand Down
2 changes: 2 additions & 0 deletions core/src/core/src/pydio/Core/Services/UsersService.php
Expand Up @@ -25,6 +25,7 @@
use Pydio\Core\Exception\UserNotFoundException;
use Pydio\Core\Exception\WorkspaceForbiddenException;
use Pydio\Core\Exception\WorkspaceNotFoundException;
use Pydio\Core\Http\Message\ReloadRepoListMessage;
use Pydio\Core\Model\Context;
use Pydio\Core\Model\ContextInterface;
use Pydio\Core\Model\FilteredRepositoriesList;
Expand Down Expand Up @@ -123,6 +124,7 @@ public static function updateUser($userObject, $scope = "user"){
CacheService::save(AJXP_CACHE_SERVICE_NS_SHARED, "pydio:user:" . $userId, $userObject);
}else{
CacheService::saveWithTimestamp(AJXP_CACHE_SERVICE_NS_SHARED, "pydio:user:" . $userId, $userObject);
Controller::applyHook("msg.instant", array(Context::contextWithObjects($userObject, null), ReloadRepoListMessage::XML(), $userObject->getId()));
}
}

Expand Down

0 comments on commit a28162f

Please sign in to comment.