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

Commit

Permalink
Hack for user specific locks and api access
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Dec 11, 2017
1 parent d269928 commit e61b5eb
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions core/src/plugins/core.conf/AbstractUser.php
Expand Up @@ -22,6 +22,7 @@

use Pydio\Core\Model\RepositoryInterface;
use Pydio\Core\Model\UserInterface;
use Pydio\Core\Services\ApplicationState;
use Pydio\Core\Services\ConfService;
use Pydio\Core\Services\RepositoryService;
use Pydio\Core\Services\RolesService;
Expand Down Expand Up @@ -345,7 +346,12 @@ public function getParent()
*/
public function canRead($repositoryId)
{
if($this->getLock() != false) return false;
if($this->getLock() != false) {
if(ApplicationState::getSapiRestBase() !== null && !$this->hasLockByName("logout")){
return $this->mergedRole->canRead($repositoryId);
}
return false;
}
return $this->mergedRole->canRead($repositoryId);
}

Expand All @@ -355,7 +361,12 @@ public function canRead($repositoryId)
*/
public function canWrite($repositoryId)
{
if($this->getLock() != false) return false;
if($this->getLock() != false) {
if(ApplicationState::getSapiRestBase() !== null && !$this->hasLockByName("logout")){
return $this->mergedRole->canWrite($repositoryId);
}
return false;
}
return $this->mergedRole->canWrite($repositoryId);
}

Expand Down

0 comments on commit e61b5eb

Please sign in to comment.