Hello
I(m trying to automatically automatically restrict a whole context (dev.mymodx.net, all resources) to Administrator group, without success.
I added to context access permissions :
dev
User group: Administrator
Auth. : 9999
Access policiy : Load, List and View
but context resources don't load when I logged as admin.
Any idea?
MODX lover
-
Développeur MODX / Webdesign / Solutions web
Assuming that you want full access to resources in that Context for admins, change the policy to Administrator. I would also change the Auth. to 0.
Flush permissions and flush all sessions after making the change.
The context should then be hidden from all non-admins. If you want others to have partial access (e.g., see the resources but not edit them), put them in a separate group and create an ACL like the one you did originally for that group.
I tried :
Context: dev
User group: Administrator
access policy: 0
Authority: Administrator
resources don't display when I'm logged as admin from modX manager and front-end (> redirection to the web context default homepage).
Need I put context resources in a "dev" resource group?
MODX lover
-
Développeur MODX / Webdesign / Solutions web
In the front end, you would have to have something like &contexts=`web,dev` in the Login snippet tag.
I can't think of any reason you wouldn't be able to see the resources in the Manager, though, unless they're in a protected resource group, or they're 'Articles', which don't show up in the tree.
Not having the 'dev' context at the root of the tree could also be a factor.
discuss.answer
I found an alternative working method after having read
Login to multiple contexts (HTTP & HTTPS) (https://forums.modx.com/thread/44880/solved-login-to-multiple-contexts-http-https).
As I suspected a problem with the propagation of login/logout status to context / sub-domains I added in System settings the value ".mydomain.net" to the session_cookie_domain key (some methods I tried works fine for the web context, not for subdomains contexts).
Then checked that the 'dev' context was not in 'anonymous' user group and added in 'Administrator' user group 'dev' context (Minimum Role > Super User / Access policy > Context).
With these settings dev.mydmodx.net subdomain and resources are only allowed for logged administrators, front-end (no need to specify &context='dev' for the Login snippet) or back end.
Just for the precision, I use Xrouting extra do dispatch subdomains to contexts.
MODX lover
-
Développeur MODX / Webdesign / Solutions web