Skip to content

Project owners who are not admins find nobody when they search for members to add #653

Description

@rubenvdlinde

What happens

A project owner who is not a Nextcloud admin or group admin opens project settings, then Members, and searches for a colleague. The search finds nobody. So only admins can add members to a project, although the creation policy can let any user create one.

Why

Read at development 6fa5ef5.

  • searchUsers() in src/components/MemberSearch.vue:119-137 calls GET /ocs/v2.php/cloud/users?search=.
  • That provisioning endpoint lists users only for admins, and for group admins only within their groups. For everyone else it returns an empty list, which the component shows as "no results".
  • The URL is built with generateUrl('/ocs/v2.php/cloud/users'). On an instance without pretty URLs this yields /index.php/ocs/v2.php/..., which does not resolve. OCS URLs need generateOcsUrl('cloud/users').

Fix direction

  1. Search through the sharee or autocomplete API that regular users may call, for example generateOcsUrl('core/autocomplete/get') with itemType set, or apps/files_sharing/api/v1/sharees. Both respect the instance's user enumeration settings.
  2. Build the URL with generateOcsUrl, and send the request through @nextcloud/axios so the request token is handled.

Live check

  1. As a regular user, with project creation open to everyone, create a project.
  2. Open project settings, then Members, and type a colleague's name. Expected today: no results.
  3. Repeat as admin. Expected: the colleague appears.

Matrix rows

prj-members in openspec/parity/capabilities.json (PR #645). The matrix rates it yes from the admin path, so the rating over-credits a regular owner.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriageAwaiting triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions