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

Class static property modelName is required in many places when we should just use name #4

Open
robere2 opened this issue Mar 4, 2023 · 0 comments
Labels
Complexity: LOW This issue is trivial and is expected to take less than an hour to complete. Module: API This issue pertains to the apps/api module Priority: LOW This issue isn't critical, security-related, or significantly beneficial to users. Type: Feature New feature or request

Comments

@robere2
Copy link
Member

robere2 commented Mar 4, 2023

Currently, we require that new classes have the static modelName property for CASL subject type detection. We should just be using the class name via Class.name instead.

modelName can still be supported as a way to have the CASL subject name differ from the actual class name. With this, we should also be checking the modelName property on constructors for objects, as well (e.g. object.constructor.modelName ?? object.constructor.name)

@robere2 robere2 added Type: Feature New feature or request Priority: LOW This issue isn't critical, security-related, or significantly beneficial to users. labels Mar 4, 2023
@robere2 robere2 transferred this issue from rpitv/glimpse-api Jan 1, 2024
@robere2 robere2 added the Module: API This issue pertains to the apps/api module label Jan 1, 2024
robere2 added a commit that referenced this issue Jan 7, 2024
Add new badges to README.md
robere2 added a commit that referenced this issue Jan 7, 2024
Add new badges to README.md
@robere2 robere2 added the Complexity: LOW This issue is trivial and is expected to take less than an hour to complete. label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: LOW This issue is trivial and is expected to take less than an hour to complete. Module: API This issue pertains to the apps/api module Priority: LOW This issue isn't critical, security-related, or significantly beneficial to users. Type: Feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant