Class static property modelName
is required in many places when we should just use name
#4
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
Currently, we require that new classes have the static
modelName
property for CASL subject type detection. We should just be using the class name viaClass.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 themodelName
property on constructors for objects, as well (e.g.object.constructor.modelName ?? object.constructor.name
)The text was updated successfully, but these errors were encountered: