indiehd / web-api

GNU Affero General Public License v3.0
6 stars 4 forks source link

Enable Policies #168

Closed mblarsen closed 4 years ago

mblarsen commented 4 years ago
mblarsen commented 4 years ago

@cbj4074 I've added and activated more policies, however, some parts of the model I need a better understanding of. I've asked here on Discord.

mblarsen commented 4 years ago

ps: @cbj4074 no need to review until "Ready for review"

cbj4074 commented 4 years ago

@mblarsen To answer your questions in the TODO list:

mblarsen commented 4 years ago
* Does this effectively mean that it doesn't even require a policy?

Yes, but it is better to be explicit about it and have an OrderPolicy that just has return true. I'll add this + Featured policy.

mblarsen commented 4 years ago

I've updated with your proposed changes.

I'm at bit unclear about delete, restore, and forceDelete in many cases.

mblarsen commented 4 years ago

I think we need to tweak this a bit. My recollection is that $song->users actually refers to users who have purchased the song, per the song_user table.

@cbj4074 I suggest renaming $song->users then to something more clear. E.g. buyers, customers, etc.

Easy to mistake to make.

mblarsen commented 4 years ago

@cbj4074 I had to refactor IndexRouteTest to use album instead of users as we have now blocked users.index.

cbj4074 commented 4 years ago

I'm at bit unclear about delete, restore, and forceDelete in many cases.

I looked at those while reviewing and I think in the vast majority of cases, if not all of them, they are correct. I will double-check them once we get this merged-in (I don't think it's critical to verify them now, nor should doing so hold-up this PR).

@cbj4074 I suggest renaming $song->users then to something more clear. E.g. buyers, customers, etc.

I agree, and will do that once this is merged.

I'm taking another look at catalogable/profile issue and will respond to that shortly...

cbj4074 commented 4 years ago

@mblarsen I took the liberty of merging your other PR into this one, and reconciling the handful of conflicts. Hopefully, I preserved all of the changes from both PRs, but please double-check my work.