plomino / Plomino

Powerful and flexible web-based application builder
33 stars 37 forks source link

setMemberProperties returning unauthorised access #841

Open AshRaghav opened 6 years ago

AshRaghav commented 6 years ago

Hi,

I am getting this message when I try to access setMemberProperties this way

membership = getToolByName(context , 'portal_membership')
DesiredMember = membership.getMemberById(DesiredMemberID)
DesiredMember.setMemberProperties(mapping={"email":UpdatedEmail})

Unauthorized: You are not allowed to access 'setMemberProperties' in this context Context is

I can update the UserName using updateLoginName but the updating properties appear to be an issue.

Any ideas?

Thanks

ebrehault commented 6 years ago

This is not related to Plomino, it is a security restriction for any PythonScripts in Plone (and Plomino uses PythonScripts to execute its formulas).

AshRaghav commented 6 years ago

Thanks @ebrehault - does it mean I won't be able to update it through the above code? or should I change the approach completely?

ebrehault commented 6 years ago

You might try to run this code in an agent and use the "Run as owner" thing so it is exectued with admin right, but it might not be enough. If so, then you need to do it outside of Plomino (in an external method or in browser view).