Skip to content
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

setMemberProperties returning unauthorised access #841

Open
AshRaghav opened this issue Mar 5, 2018 · 3 comments
Open

setMemberProperties returning unauthorised access #841

AshRaghav opened this issue Mar 5, 2018 · 3 comments

Comments

@AshRaghav
Copy link

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
Copy link
Member

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
Copy link
Author

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
Copy link
Member

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants