collectives icon indicating copy to clipboard operation
collectives copied to clipboard

Allow to rename Collective for admins

Open mgrundkoetter opened this issue 9 months ago • 7 comments

Renaming an existing Collective is currently only allowd for the creator of the Collective, anyone else.

It would be nice if everyone configured as admin level user in this collective was able to rename the collective. Maybe I am missing some way to already do this right now, then I am grateful for tips how to do so.

Environment: Nextcloud Hub 9 (30.0.6)

mgrundkoetter avatar Apr 11 '25 12:04 mgrundkoetter

@mejo- I think this actually belongs to https://github.com/nextcloud/circles

If I understand it right, the circles app checks for permissions in circles/lib/FederatedItems/CircleEdit.php:78 the function verify() calls:

$initiatorHelper->mustBeOwner();

which inturn calls: $this->mustHaveLevelEqualOrAbove(9);

This however is false for admins:

	public function mustHaveLevelEqualOrAbove(int $level) {
		if ($this->member->getLevel() < $level) {
			throw new MemberLevelException('Insufficient rights');
		}
	}

Should we move this to circles?

janbaum avatar Oct 12 '25 12:10 janbaum

Great analysis @janbaum! Indeed the Teams app currently limits renaming of a team to the owner. I asked one of the maintainers whether they would be open to changing this.

In any case, I would rather open a new issue against the Teams app instead of transferring this one, as even if gets fixed in Teams, we still need to adjust some code on our side.

Another option would be to create an own API endpoint in Collectives for renaming a team and a renameCircle() function in our CircleHelper class by using startSuperSession().

mejo- avatar Oct 13 '25 08:10 mejo-

I think this would best fit into the admin view on users and groups as a separate teams section. That way admins see their own collectives only in collectives just like they see their own teams only in contacts and managing other teams and groups happens in the account admin interface.

max-nextcloud avatar Oct 13 '25 11:10 max-nextcloud

@max-nextcloud to my understanding, this issue is about renaming a collective as team member with admin role, not about admins of the Nextcloud instance. Currently this is only possible for the owner of the team, which is always just one person (either the one who created the team/collective, or the one who got the owner role inherited after the original owner left the team).

mejo- avatar Oct 13 '25 12:10 mejo-

@mejo- @max-nextcloud I sat down and tried my luck a bit. I think I am very close, but standing infront of a problem:

The circlesManager doesnt provide the function editName() from circles LocalController. If I understand it right we would have to do something like $this->circleService ... but this wasn't done before in CircleHelper so I was unsure what implications that would have, since the circlesManager will have it's reasons that it doesnt include this function, or?

Anyways I will push my progress to my fork today, so maybe it's easier to discuss it if you see what i mean :)

janbaum avatar Oct 13 '25 14:10 janbaum

Anyways I will push my progress to my fork today, so maybe it's easier to discuss it if you see what i mean :)

https://github.com/janbaum/collectives/tree/fix/allow-admin-rename

janbaum avatar Oct 13 '25 14:10 janbaum

I opened a PR in circles: nextcloud/circles#2190

janbaum avatar Oct 29 '25 11:10 janbaum