@@ -67,7 +67,8 @@ public function getResourceAction($repositoryName, $path)
67
67
try {
68
68
$ repository = $ this ->registry ->get ($ repositoryName );
69
69
70
- $ this ->guardAccess ('read ' , $ repositoryName , $ repository ->resolvePath ($ path ));
70
+ $ fullPath = method_exists ($ repository , 'resolvePath ' ) ? $ repository ->resolvePath ($ path ) : $ path ;
71
+ $ this ->guardAccess ('read ' , $ repositoryName , $ fullPath );
71
72
72
73
$ resource = $ repository ->get ($ path );
73
74
@@ -102,11 +103,12 @@ public function getResourceAction($repositoryName, $path)
102
103
*/
103
104
public function patchResourceAction ($ repositoryName , $ path , Request $ request )
104
105
{
105
- $ this ->guardAccess ('write ' , $ repositoryName , $ path );
106
-
106
+ $ path = '/ ' .ltrim ($ path , '/ ' );
107
107
$ repository = $ this ->registry ->get ($ repositoryName );
108
108
109
- $ path = '/ ' .ltrim ($ path , '/ ' );
109
+ $ fullPath = method_exists ($ repository , 'resolvePath ' ) ? $ repository ->resolvePath ($ path ) : $ path ;
110
+ $ this ->guardAccess ('write ' , $ repositoryName , $ fullPath );
111
+
110
112
111
113
$ requestContent = json_decode ($ request ->getContent (), true );
112
114
if (!$ requestContent ) {
@@ -142,11 +144,11 @@ public function patchResourceAction($repositoryName, $path, Request $request)
142
144
*/
143
145
public function deleteResourceAction ($ repositoryName , $ path )
144
146
{
145
- $ this ->guardAccess ('write ' , $ repositoryName , $ path );
146
-
147
+ $ path = '/ ' .ltrim ($ path , '/ ' );
147
148
$ repository = $ this ->registry ->get ($ repositoryName );
148
149
149
- $ path = '/ ' .ltrim ($ path , '/ ' );
150
+ $ fullPath = method_exists ($ repository , 'resolvePath ' ) ? $ repository ->resolvePath ($ path ) : $ path ;
151
+ $ this ->guardAccess ('write ' , $ repositoryName , $ fullPath );
150
152
151
153
$ repository ->remove ($ path );
152
154
0 commit comments