-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add REST route for managing groups and users #12618
Conversation
@@ -71,6 +80,9 @@ public function __construct(array $urlParams=array()){ | |||
$container->registerService('L10N', function(SimpleContainer $c) { | |||
return $c->query('ServerContainer')->getL10N('settings'); | |||
}); | |||
$container->registerService('GroupManager', function(SimpleContainer $c) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use IContainer - SimpleContainer is not in the public namespace
bb48151
to
b15abd7
Compare
@LukasReschke Still WIP or ready for final review? |
8b84369
to
acfaa24
Compare
@MorrisJobke Still not perfect but IMHO ready to review. |
acfaa24
to
a202d01
Compare
Don't be shocked by that enormous amount of changes… - Most of it are unit tests… |
3cc1afd
to
628f917
Compare
@DeepDiver1975 Care to review this as well? @Raydiation Just FYI regarding some AppFramework usage in core. - If you want to review this as well: You're more than welcome :-) (Yes - I know that static |
$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { | ||
\OC_Hook::emit('OC_Group', 'pre_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); | ||
}); | ||
return $groupManager; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@icewind1991 Your feedback on that, please. THX!
66cf32e
to
830a3a6
Compare
@@ -188,12 +188,12 @@ DeleteHandler.prototype.deleteEntry = function(keepNotification) { | |||
|
|||
var payload = {}; | |||
payload[dh.ajaxParamID] = dh.oidToDelete; | |||
console.log(dh); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this needs to be removed ;)
test plan:
bugs:
|
I'm fine with this except the mentioned bug above. Once this is fixed I will give my thumbs up |
First step of a somewhat testable user management. - I know, the JSON returns are in an ugly format but the JS expects it that way. So let's keep it that way until we have time to fix the JS in the future.
227bb58
to
fe7d9a7
Compare
@MorrisJobke Should be fixed now. |
@@ -153,6 +153,24 @@ public function delete() { | |||
$this->emitter->emit('\OC\User', 'preDelete', array($this)); | |||
} | |||
$result = $this->backend->deleteUser($this->uid); | |||
if ($result) { | |||
|
|||
// FIXME: Feels like an hack - suggestions? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what way ?
Should the storage removal happen somewhere else maybe, through registering to a deleteUser
hook ? Maybe something for another time ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd vote to have it done triggered by a hook, but this is not urgent. This goes beyond just deleting and sometimes it might (pure speculation) be useful to have the possibility to "reset" a user. But as long as we don't have the need for it, it is ok to leave it for now/OC 8 like this.
Code looks good apart from the HTTP codes part. |
….com/owncloud/core into initial-work-migrate-to-appframework
I added proper HTTP status codes with 8b3e389. - Please double check if I choose the right ones ;-) |
|
That should be fixed with c239578, though I only changed the response format and JS where necessary and not on every controller. That's something for later. |
@LukasReschke Can you go to the jenkins branch and merge your changes in? |
Let me try… |
Done. - Let's wait… |
The inspection completed: 288 new issues, 41 updated code elements |
From #12693 (comment) 🚀 Test PASSed. 🚀 |
@PVince81 Can I consider this as 👍? ;-) |
Yes, 👍 |
…amework Add REST route for managing groups and users
First step of a somewhat testable user management. - I know, the JSON returns are in an ugly format but the JS expects it that way. So let's keep it that way until we have time to fix the JS in the future.
Todo (group):
Add possibility to rename group (update)(requires more work - let's do this later)Todo (user):
Add possibility to manage users (update)(requires more work - let's do this later in single steps instead one large one…)FIXME:
Requires #12619
@MorrisJobke