summaryrefslogtreecommitdiffstats
path: root/lib/private/Authentication/Token/DefaultToken.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-08-03 15:57:06 +0200
committerRobin Appelman <robin@icewind.nl>2016-11-16 15:24:27 +0100
commit1afccde16a04f9a91f9c5c46090517a54670f34d (patch)
tree400495cbb0f40c7054b5fc63539d3546aac1975b /lib/private/Authentication/Token/DefaultToken.php
parentb4e27d35f59e359eb7591a15c7f037968081eb1b (diff)
downloadnextcloud-server-1afccde16a04f9a91f9c5c46090517a54670f34d.tar.gz
nextcloud-server-1afccde16a04f9a91f9c5c46090517a54670f34d.zip
allow configuring filesystem access
Signed-off-by: Robin Appelman <icewind@owncloud.com>
Diffstat (limited to 'lib/private/Authentication/Token/DefaultToken.php')
-rw-r--r--lib/private/Authentication/Token/DefaultToken.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/private/Authentication/Token/DefaultToken.php b/lib/private/Authentication/Token/DefaultToken.php
index e938ff92e16..b32f9cc9866 100644
--- a/lib/private/Authentication/Token/DefaultToken.php
+++ b/lib/private/Authentication/Token/DefaultToken.php
@@ -124,7 +124,7 @@ class DefaultToken extends Entity implements IToken {
'name' => $this->name,
'lastActivity' => $this->lastActivity,
'type' => $this->type,
- 'scope' => $this->getScope()
+ 'scope' => $this->getScopeAsArray()
];
}
@@ -147,7 +147,18 @@ class DefaultToken extends Entity implements IToken {
}
public function getScope() {
- return json_decode(parent::getScope(), true);
+ return parent::getScope();
+ }
+
+ public function getScopeAsArray() {
+ $scope = json_decode($this->getScope(), true);
+ if (!$scope) {
+ return [
+ 'filesystem'=> true,
+ 'apps' => []
+ ];
+ }
+ return $scope;
}
public function setScope($scope) {