Quote from: MediaGuy at Dec 13, 2009, 02:02 PM
Is it possible to assign manager user groups to a language so that I can manage what languages people can manage? The idea is to assign manager users to a group and then bind that group to 1 or more languages. That way people can only change their own language and not mess with the others.
I think it is the easiest to manage this through ManagerManager, but how can I arrange this?
Nice idea. I can see how that would be useful. I agree that it would be easiest to implement this using ManagerManager. Please can you try out the attached patch to the yams.mm_rules.inc.php file which should add such functionality?
To use this you need to define an array called $yamsLanguageRoleMap which maps language ids to a comma separated list of roles (ManagerManager format) that can access the language. For example
$yamsLanguageRoleMap = array( 'en' => '1' );
would mean that only administrators (role 1) would have access to English.
$yamsLanguageRoleMap = array( 'en' => '!1' );
would mean that all roles apart from administrators (role 1) would have access to English.
If a language is left out of the array, all roles have access to the language. If the $yamsLanguageRoleMap array is not defined at all YAMS falls back to the default of allowing all roles access to all languages.
You need to define this array before the
require( $modx->config['base_path'] . 'assets/modules/yams/yams.mm_rules.inc.php' );
line in your ManagerManager rules chunk.
Let me know how you get on.
EDIT: If this works fine, then for the next release I will probably add the $yamsLanguageRoleMap array to the YAMS config file and allow it to be managed via the YAMS module interface.