mevdschee / mevdschee/php-crud-api

/register endpoint, permissions

Open
#733 6 comments 1 reaction 1 assignee View on GitHub

@mevdschee is already working on this.

Since Nov 28, 2020.

enhancement
Dominant language
PHP
Stars
3.7k
Forks
1k
Avg merge
1h 55m
Merged PRs (30d)
7

Description

Hi Maurits,

Once again, great job on a welcomed feature (/register endpoint and dbAuth.registerUser middleware config)!

Do you think if it would be feasible to add a config (or use the same dbAuth.registerUser config) that would allow us to specify what operations should be allowed on this endpoint (e.g.: allow-overwrite / unique, something like that) - maybe, failing if we try something that is not allowed, etc. ?

Scenario: I have a predefined user (let's call it "super-admin"). This super-admin user, after being logged in, will try to register a new user via the /register endpoint.
Now, the api allows us to repeat this operation, basically adding the same user to the db multiple times. Could we stop this behaviour via a config option? This is just for discussion, and, maybe, future enhancement of this (really great) endpoint.

Cheers! Keep the good work comin'!

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.