Ok,
It was about giving WebUser proper policy: ’save’, ’save_document’. Could be only those attribs.
It’s important user is logged into ’mgr’ context.
vide: $_SESSION[’modx.user.contextTokens’][’mgr’] = 1;
-
MODX Staff
- 10,725 Posts
You can assign the policies to a context other than mgr. The user does not have to have a mgr context login, but you do have to log them into the context you want them to get the policy from.
Ok, but if I want to make Ajax calls to connectors (used by manager) from within ’web’ (or any other context) I will get permission denied (or empty Response in Revo2.0.0beta-3).
It seems I have to write my own connectors and I can’t use existing ones.
-
MODX Staff
- 10,725 Posts
I have tested these before and it should work from any context you give a User Group access to the permissions defined in your policy.
But it didnt. I gave ’web’ context access permissions (context policy) to a UserGroup. And the user couldn’t get this data (he was SuperUser in this group). He had to be logged in to ’mgr’ context and have proper access permissions for that context (with proper policy - I just created one with few permissions).
It’s true only for some connectors - they always return data (permission: true) but there’re some (quite a few) which return (permission: false) or even nothing.
-
MODX Staff
- 10,725 Posts
Maybe if you are more specific about what the attributes in your policies are and what connectors you are trying to access with them, we could have a more productive dialog on what the problem might be.
url: MODx.config.connectors_url+’resource/index.php’
$_GET[’action’] = ’update’
$_POST has all resource fields needed to update.
I use custom policy: ’save’, ’save_document’, ’access_permissions’
-
MODX Staff
- 10,725 Posts
In order to use the Resource update processor from, for example, the web context, you would need save_document and possibly publish_document. The save attribute refers to the ability to save changes to the context object itself in this case, FYI. In addition, you need to make sure the user has the save attribute on the Resource policy, if any are applied via Resource Groups. Regardless, the response from the connector should at least give you the appropriate security error if you don’t have those attributes. If you are getting other errors, say in core/cache/logs/error.log related to the connector, then we have other issues to discuss.
Sorry for the slow response; I’ve been extremely ill the past week and a half...