Skip to content

Allow creating a model that does not 'allow' anyone. #569

@naedx

Description

@naedx

Is your feature request related to a problem? Please describe.

I am creating a model that my users do not access directly. As such, I do not want to be forced to allow anyone.

Describe the solution you'd like

Either:

  • simply deny by default if .authorization() is not called
  • provide allow.nobody() as in .authorization((allow) => [allow.nobody()]) which allows the user to be explicitly deny access.

Describe alternatives you've considered

As a temporary workaround, I've chosen to use @auth(rules: [{allow: owner, ownerField: "_never_"}]) which is a field that wont be populated. I still see, however, that there is an unwanted field resolver defined automatically called MyModel_never_DataResolverFn.

    .authorization((allow) => [allow.ownerDefinedIn('_never_')]);

Additional context

Add any other context or screenshots about the feature request here.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions