question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proposal (breaking): Change the way scripted document updates are handled

See original GitHub issue

While I was working on something, I realized that for every doc.insert or doc.save the document’s last update is attributed to the session user and also permissions are validated. When done programmatically either via a script or controller (example: changing status of an Issue to “Open” when a new Communication is made), this is wrong because the session user does not control the internal update. So I am proposing 2 changes:

  1. Don’t attribute the change to the session user, attribute it to a system user, maybe create a new user called “System” that indicates that the document was updated programmatically, or just use “Administrator” (but that is also wrong)
  2. Don’t check permissions internally. Default ignore_permissions to True except for REST API updates.

Planning to send a fix soon to develop in time for v14. I understand there maybe certain security concerns on bypassing permissions check, but if the updater is “System”, then those checks are mostly meaningless. There are upteen cases where we have to add ignore_permissions=True on the ORM update - which we can now avoid.

If there are any other major concerns, please share!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
barredterracommented, Jan 13, 2022

Just noticed this behaviour today, in one of our sites. Your proposal would make things clearer. Minor issue, but it seems unfair to 'blame" users for system behaviour.

1reaction
aakvatechcommented, Jan 13, 2022

Would there a global setting per app that ignores or allows by default?

So that should there be a security sensitive organization that wants to force check for all custom apps, then it can be enforced.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Proposal] List of version 4.0 (breaking?) changes #890 - GitHub
petekanev changed the title List of upcoming 4.0 breaking changes ... post-install script is not the best way of handling the plugins.
Read more >
Semantic Versioning 2.0.0 | Semantic Versioning
Version 1.0.0 defines the public API. The way in which the version number is incremented after this release is dependent on this public...
Read more >
How to write a business proposal [Updated 2022] | PandaDoc
1. This section includes basic information like your company’s name and contact information, your company logo, your client’s name and contact information, the...
Read more >
Explicit exceptions - a solution to fragile code dealing with ...
I've been thinking about exception handling in Javascript a lot recently, ... It's difficult to refactor code without making breaking changes.
Read more >
Making projects resistant to breaking changes - FreeCAD Forum
Also, that would keep track of all the temporary features, history undo etc. The real "source code" for a FCStd file is… the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found