Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
8b517945
Commit
8b517945
authored
Oct 30, 2015
by
Roeland Jago Douma
Browse files
Options
Downloads
Patches
Plain Diff
Prepare OCS Share endpoint
parent
9567fa11
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/files_sharing/api/ocssharewrapper.php
+62
-0
62 additions, 0 deletions
apps/files_sharing/api/ocssharewrapper.php
apps/files_sharing/appinfo/routes.php
+8
-5
8 additions, 5 deletions
apps/files_sharing/appinfo/routes.php
with
70 additions
and
5 deletions
apps/files_sharing/api/ocssharewrapper.php
0 → 100644
+
62
−
0
View file @
8b517945
<?php
/**
* @author Roeland Jago Douma <rullzer@owncloud.com>
*
* @copyright Copyright (c) 2015, ownCloud, Inc.
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace
OCA\Files_Sharing\API
;
class
OCSShareWrapper
{
private
function
getShare20OCS
()
{
return
new
share20OCS
(
new
\OC\Share20\Manager
(
\OC
::
$server
->
getUserSession
()
->
getUser
(),
\OC
::
$server
->
getUserManager
(),
\OC
::
$server
->
getGroupManager
(),
\OC
::
$server
->
getLogger
(),
\OC
::
$server
->
getAppConfig
(),
\OC
::
$server
->
getUserFolder
(),
new
\OC\Share20\DefaultShareProvider
(
\OC
::
$server
->
getDatabaseConnection
()
)
),
\OC
::
$server
->
getGroupManager
(),
\OC
::
$server
->
getUserManager
(),
\OC
::
$server
->
getRequest
(),
\OC
::
$server
->
getUserFolder
());
}
public
function
getAllShares
(
$params
)
{
return
\OCA\Files_Sharing\API\Local
::
getAllShares
(
$params
);
}
public
function
createShare
(
$params
)
{
return
\OCA\Files_Sharing\API\Local
::
createShare
(
$params
);
}
public
function
getShare
(
$params
)
{
return
\OCA\Files_Sharing\API\Local
::
getShare
(
$params
);
}
public
function
updateShare
(
$params
)
{
return
\OCA\Files_Sharing\API\Local
::
updateShare
(
$params
);
}
public
function
deleteShare
(
$params
)
{
return
\OCA\Files_Sharing\API\Local
::
deleteShare
(
$params
);
}
}
This diff is collapsed.
Click to expand it.
apps/files_sharing/appinfo/routes.php
+
8
−
5
View file @
8b517945
...
...
@@ -61,29 +61,31 @@ $this->create('sharing_external_add', '/external')
//TODO: SET: mail notification, waiting for PR #4689 to be accepted
$OCSShare
=
new
\OCA\Files_Sharing\API\OCSShareWrapper
();
API
::
register
(
'get'
,
'/apps/files_sharing/api/v1/shares'
,
array
(
'\OCA\Files_Sharing\API\Local'
,
'getAllShares'
)
,
[
$OCSShare
,
'getAllShares'
]
,
'files_sharing'
);
API
::
register
(
'post'
,
'/apps/files_sharing/api/v1/shares'
,
array
(
'\OCA\Files_Sharing\API\Local'
,
'createShare'
)
,
[
$OCSShare
,
'createShare'
]
,
'files_sharing'
);
API
::
register
(
'get'
,
'/apps/files_sharing/api/v1/shares/{id}'
,
array
(
'\OCA\Files_Sharing\API\Local'
,
'getShare'
)
,
[
$OCSShare
,
'getShare'
]
,
'files_sharing'
);
API
::
register
(
'put'
,
'/apps/files_sharing/api/v1/shares/{id}'
,
array
(
'\OCA\Files_Sharing\API\Local'
,
'updateShare'
)
,
[
$OCSShare
,
'updateShare'
]
,
'files_sharing'
);
API
::
register
(
'delete'
,
'/apps/files_sharing/api/v1/shares/{id}'
,
array
(
'\OCA\Files_Sharing\API\Local'
,
'deleteShare'
)
,
[
$OCSShare
,
'deleteShare'
]
,
'files_sharing'
);
API
::
register
(
'get'
,
...
...
@@ -130,3 +132,4 @@ API::register('get',
'/apps/files_sharing/api/v1/sharees'
,
[
$sharees
,
'search'
],
'files_sharing'
,
API
::
USER_AUTH
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment