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)
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
)