-
-
Notifications
You must be signed in to change notification settings - Fork 834
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
Deprecate AssertPermissionTrait #2044
Deprecate AssertPermissionTrait #2044
Conversation
336a57a
to
d9c1756
Compare
What were the motivations behind this change ? Why get rid of |
I believe the idea is encapsulation. These methods all operate on the user/actor objects, so it makes sense that they are owned by the Yes, this adds more code to On a more serious note. I could see us reducing or at least separating the responsibilities by introducing an interface for actor-related things. That would help in e.g. at least decoupling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I'd be happy with this change! (Want to wait for others' responses.)
I found two small copy-paste mistakes (?), though...
@franzliedke can't we move this out of the User class into a Concerns/trait please? It's what I proposed in the user preferences as well and it would help keep Users clean. |
@luceos We could. Personally, I rarely see the benefit in extracting a trait if it's not for the purpose of sharing code. In this case, we would just try to conceal the fact that the class is too big / doing too much. On the downside, I tend to be surprised by traits, because I often forget to consider them (or simply overlook them) when searching for a method's implementation. Not too strong an opinion, curious to hear what others think. |
d9c1756
to
c336d56
Compare
I also see traits as a mechanism for sharing functionality among unrelated classes moreso than a way to split up big classes 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please squash and rebase, then I'll gladly merge.
0c812e0
to
95623ea
Compare
@askvortsov1 That did not go well. 😱 |
e17965c
to
5694438
Compare
@franzliedke here we go :D 🙈 |
5694438
to
feb45b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I don't see any more issues and it appears that Franz problem was resolved.
Any volunteers for applying this change to all bundled extensions? 😁 |
@franzliedke I'll take care of it this weekend once I get done meeting the dog I might be adopting. |
**Fixes #1320 **
Changes proposed in this pull request:
Deprecate the AssertPermissionTrait. We should merge this in the next release to give extension authors time to adjust prior to stable.
Confirmed
composer test
).