-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
dev/core#2486 - Use read-only permissions for FinancialItem API #20499
Conversation
(Standard links)
|
beee51b
to
ae8ee11
Compare
e189d94
to
ee73f13
Compare
So FinancialItems are never allowed to be created or updated? |
(For posterity: this PR+discussion is an offshoot from https://chat.civicrm.org/civicrm/pl/ey1myeenuj813qcxoi8hjwqhdh) @colemanw Correct. I understand these to be special-purpose logging-tables. Here's a description of the financial entities from @JoeMurray: https://civicrm.stackexchange.com/questions/28197/what-is-a-line-item-and-what-is-a-financial-item-and-how-are-those-two-linked-t with a notable excerpt:
|
I'm fine with this - but I would note that we call the apiv3 version of this api from internal code - we have traditionally encouraged api use in internal code for readability & consistency reasons |
@eileenmcnaughton Yeah, it seems to me that (in this approach) you should be able to call APIv4 |
@totten OK that's great - ie we mostly use checkPermissions = FALSE once we are deep in the BAO |
@totten I don't have any concerns about this based on the above - go ahead & merge if this makes sense to you |
1 similar comment
@totten I don't have any concerns about this based on the above - go ahead & merge if this makes sense to you |
cv ev -U admin 'civicrm_api4("FinancialItem","create",["checkPermissions"=>TRUE]);'
cv ev -U admin 'civicrm_api4("FinancialItem","create",["checkPermissions"=>FALSE]);' As expected, the patch introduces an authorization-failure if you enable permissions -- and it still allows the call if you skip permissions. Merging. |
Thanks @totten for merging this. @eileenmcnaughton should I make similar change to LineItem and EntityFinancialTrxn ? |
@monishdeb yeah - probably - I think there might be others too |
Overview
Add permissions for financial_item entity
Before
No permission declared for financial_item
After
Financial Item got permissions, and prevent create/update action.
Comments
This is a follow-up to #20433.
ping @colemanw @eileenmcnaughton @totten