Running Scripts referring to inaccessible matrices

Generic selectors
Exact matches only
Search title only
Search in content
Search in all posts
Search in pages
Answers
Questions
Solved2.05K viewsScripting
0

I noted in one of the recent version releases that it is now possible to make scripts refer to a matrix that a user is not given access of in permissions. Kindly advise what we need to add in the script for this to work.

Selected answer as best
0

From our engineering team…

Scripts are now run in the permission profile of the current user. This does not allow the user to modify a matrix they do not have access to. The script author can elevate the privileges of the script being run by using a privileged block. For example

privileged {
|Matrix1::A|.children.create(4)
}

If for some reason the user does not have access to Matrix1 or does not have rights to create items on category A, the privileged block temporarily elevates the privilege of the user in order to perform the actions inside the privileged block.

Selected answer as best
0

Thanks Mike, this is exactly what I was looking for.