frappe.permission.has_permission won't accept raise_exception anymore,
it was extremely misleading argument and actual purpose of the argument
was to print perm check logs.
Doing has_permission and then manually raising exception erases the perm check messages.
This causes insane amounts of confusion when perm error says X not
permitted while user is trying to check Y.
* fix: set correct recipient when reply to own email
When Sender clicks on reply to own email, the recipient is set to the Sender's email address instead of the original ( last_email ) recipient.
Added a check if sender is composing a reply to own email and set the recipient to the original ( last_email ) recipient.
* Update communication.js
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
---------
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
BREAKING CHANGE:
before: `has_permission` hooks need to explicitly return "False" to block a user.
after: `has_permission` hook need to explicitly return "True" (or truthy) value to allow user. They will be blocked otherwise.
Why? Everything related to permission should be block by default and allow if some checks pass.
Translation assets are also... assets, so grouping them with `bench build`.
We can do some special function but that will likely require updating
bench for everyone. Not so ideal.
Also renamed `compile` function as it is a builtin in python.
`policy=SMTPUTF8` seems to break without specifying SMTPUTF8 in mail_options when actually sending the mail
(can't validate this because no server I tried seems to support that)
The `default` or `SMTP` policy work fine. Stuck to `SMTP` for CRLF line endings - default only does LF
Can get away with just changing this for SendMailContext().get_message_object(), but seemed better to standardize it
Non ASCII characters in the subject break completely, for example hindi characters get replaced by `?`
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
* feat: permission debugger
This PR adds a virtual doctype that can run has_permission for
doctype-docname-user-ptype combinations and spit out detailed log for
why/where some permissionw as denied or granted.
This isn't supposed to be programatic, it's just textual dump of what code is doing.
IMO a better debugger can be written but that will require extensive
rewrite of perm checks first. All debugging, error messages in current
systems are bolted on top with hacks to avoid messing with
implementation.
* fix: capture UP pass check
* fix: reset docname on changing doctype
* fix: docname is optional
* fix: debug doctype perms