Review: Needs Fixing code

33      + store = Store.of(self)
34      + grants_for_user = store.using(
35      + AccessPolicy,
36      + Join(
37      + AccessPolicyGrant,
38      + And(
39      + AccessPolicyGrant.policy_id == AccessPolicy.id,
40      + AccessPolicyGrant.grantee_id == user.id))).find(
41      + AccessPolicyGrant,
42      + AccessPolicy.product_id == self.id,
43      + AccessPolicy.type == self.information_type)
44      + if grants_for_user.is_empty():
45      + return False

This looks remarkably like IAccessPolicyGrant.find() ? Can you just call into 
that?

223     + owner = product.owner
227     + self.makeAccessPolicyGrant(policy, grantee=owner)

Surely you can just say grantee=product.owner?
-- 
https://code.launchpad.net/~adeuring/launchpad/correct-permission-check-for-iproduct/+merge/127518
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.

_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to