I have reviewed the patch as well and I too share your concerns.
I also have concerns about having policy logic in the plugins (policy should be plugin-independent, and increased number of calls into the db).
The proposed patch appears to add unnecessary policy checks, as the following:
"default": [["rule:admin_or_owner"]],
should also be called by default for every router operation. Also, as you pointed out in the comments, referenced policies are different from the one actually entered in policy.json, so they should never be hit.
Akihiro,
I have reviewed the patch as well and I too share your concerns.
I also have concerns about having policy logic in the plugins (policy should be plugin-independent, and increased number of calls into the db).
The proposed patch appears to add unnecessary policy checks, as the following:
"default": [["rule: admin_or_ owner"] ],
should also be called by default for every router operation. Also, as you pointed out in the comments, referenced policies are different from the one actually entered in policy.json, so they should never be hit.
I will do some more tests later on today.