flarum / issue-archive

0 stars 0 forks source link

ModelPrivate extender doesn't apply to subclasses #132

Open askvortsov1 opened 3 years ago

askvortsov1 commented 3 years ago

Feature Request

Is your feature request related to a problem? Please describe. Previously, GetModelIsPrivate would be dispatched in the static::boot method of Discussion and Post, meaning it would be inherited to Post subclasses, since the boot method would be called for each subclass.

Now, the checkers are only applied for the class explicitly specified, not for any subclasses.

Describe the solution you'd like We could either:

Justify why this feature belongs in Flarum's core, rather than in a third-party extension Consider who this change will be useful to – most Flarum forums, or just a few?

Describe alternatives you've considered We could leave it as is: frankly, I think that would suffice, as marking content private is only relevant for user generated content, and at that point:

Implementing subclass support is difficult because the saving listeners are attached outside the models, so we'd need to get ALL registered classes and check for inheritance, which is a lot of classes, and might have performance implications.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum. In any case, thanks for taking an interest in this software and contributing by opening the issue in the first place!