nextcloud / nextcloud/deck

Handle permission checks in the controllers

Open
#3,662 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop feature: api feature: sharing technical debt
Dominant language
JavaScript
Stars
1.4k
Forks
354
Avg merge
1d 10h
Merged PRs (30d)
43

Description

Currently permission checks happen at the service classes which is kind of hard to maintain, especially when trying to reuse services outside of user calls e.g. within occ command that do not have a current user present.

Ideally the permission checks should rather happen at the controller level.

Enforcing through annotations like in talk seems like a nice approach https://github.com/nextcloud/spreed/blob/master/lib/Middleware/InjectionMiddleware.php

Additional caution required to avoid duplicate queries with the relational object structure we have.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the permission checks in the service classes and their controller callers. Read the referenced spreed lib/Middleware/InjectionMiddleware.php example, then define how controller-level checks can support occ commands without a current user and avoid duplicate queries in the relational object structure. Done means the design and affected entry points are agreed.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
authorization, backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.