Skip to content

Quick fix to prevent group admin to delete an user - #22793

Closed
hugocollignon wants to merge 1 commit into
owncloud:masterfrom
hugocollignon:patch-1
Closed

hugocollignon wants to merge 1 commit into
owncloud:masterfrom
hugocollignon:patch-1

Conversation

@hugocollignon

Copy link
Copy Markdown

Simple patch for #3362

@mention-bot

Copy link
Copy Markdown

By analyzing the blame information on this pull request, we identified @DeepDiver1975, @MorrisJobke and @icewind1991 to be potential reviewers

@ghost

ghost commented Mar 2, 2016

Copy link
Copy Markdown

@hugocollignon

Thanks a lot for your contribution!
Contributions to the core repo require a signed contributors agreement http://owncloud.org/about/contributor-agreement/

Alternatively you can add a comment here where you state that this contribution is MIT licensed.

Some more details about out pull request workflow can be found here: http://owncloud.org/code-reviews-on-github/

$tr.find('td.remove').append(deleteLink);
} else if (OC.currentUser === user.name) {
$tr.find('td.remove a').remove();
if (OC.currentUser === 'admin') {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on the portability of this code?

This only checks whether the currently logged-in user is named "admin". I doubt that this is what we want to do here 😉

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To check for admin permission in the JS code, use OC.isUserAdmin().

@MorrisJobke

Copy link
Copy Markdown
Contributor

@PVince81

Copy link
Copy Markdown
Contributor

The ticket #3362 is a feature request to make subadmin permissions tweakable, which would imply adding config switches in some places and possibly a UI for admins to configure what subadmin are allowed to do.

While this might be a quick fix, this short additional will change the default behavior without providing a way to bring it back.

I'm closing this due to lack of feedback.
Feel free to reopen or submit another pull request. Maybe adding a config switch would be a more acceptable solution.

Thank you for your understanding and also for your interest in contributing !

@lock

lock Bot commented Aug 5, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants