Permalink
Browse files

Send instant message with empty repository when saving user / group r…

…ole. We should have a similar strategy to publish a message to a role scope as well.
  • Loading branch information...
1 parent 4a2830f commit a28162f1fd241f2498362f592dc9d83227e591be @cdujeu cdujeu committed Sep 29, 2016
@@ -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;
@@ -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));
+ }
}
/**
@@ -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;
@@ -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()));
}
}

0 comments on commit a28162f

Please sign in to comment.