Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically discover available permissions #1706

Merged
merged 23 commits into from
Feb 22, 2024

Conversation

fraxachun
Copy link
Contributor

Adds dependency https://github.com/golevelup/nestjs/tree/master/packages/discovery

We lose code completion in RequiredPermission-decorator and getPermissionsForUser as there are only strings but that's not a huge deals as the system gets much more flexible.

@fraxachun fraxachun force-pushed the user-permissions-permission-discovery branch from 1e8131e to 0c0d506 Compare February 15, 2024 13:25
@fraxachun fraxachun changed the title Get availablePermission fro DiscoveryService Get availablePermissions from DiscoveryService Feb 15, 2024
@nsams
Copy link
Member

nsams commented Feb 15, 2024

great! I think that is a huge simplification

nsams
nsams previously approved these changes Feb 15, 2024
nsams
nsams previously approved these changes Feb 19, 2024
Copy link
Member

@nsams nsams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changelog entry is missing

@fraxachun
Copy link
Contributor Author

fraxachun commented Feb 19, 2024

changelog entry is missing

1689c72

nsams
nsams previously approved these changes Feb 19, 2024
nsams
nsams previously approved these changes Feb 21, 2024
@fraxachun
Copy link
Contributor Author

I added a commit which exports the permissions used in cms-api

nsams
nsams previously approved these changes Feb 22, 2024
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
@fraxachun
Copy link
Contributor Author

Didn't we decide to deprecate the option and log a warning if it's used in an application?

7efdfc7

Copy link
Collaborator

@johnnyomair johnnyomair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use the cometPermissions object in Demo please?

@johnnyomair johnnyomair changed the title Get availablePermissions from DiscoveryService Automatically discover available permissions Feb 22, 2024
fraxachun and others added 5 commits February 22, 2024 11:38
…es.ts

Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
- `packageDimensions` was nullable, although the database fields aren't
nullable (caused an DB error if null was saved)
- Admin Generator (present and future) doesn't support nested fields
(for future it is WIP, present will never get it)
- Easy solution: remove it
- #1729 will showcase nested fields and everything (as replacement for
packageDimensions)
@fraxachun
Copy link
Contributor Author

Could you use the cometPermissions object in Demo please?

894e174

However, my opinion is that the cometPermissions-object as well as deprecating the availablePermissions-option would not be necessary.

@fraxachun
Copy link
Contributor Author

@nsams @johnnyomair Reverted the last commits

@fraxachun fraxachun merged commit beeea1d into main Feb 22, 2024
11 checks passed
@fraxachun fraxachun deleted the user-permissions-permission-discovery branch February 22, 2024 14:06
thomasdax98 pushed a commit that referenced this pull request Feb 23, 2024
Adds dependency
https://github.com/golevelup/nestjs/tree/master/packages/discovery

We lose code completion in RequiredPermission-decorator and
getPermissionsForUser as there are only strings but that's not a huge
deal as the system gets much more flexible.

---------

Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
Co-authored-by: Ben-Ho <bh@vivid-planet.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants