Sure. Using Doodles as an example, you can create a new access policy template and add a new permission: doodles.edit_grid
Then assign this permission only to user groups who you want to be able to edit the grid. The others will be read-only.
Create a plugin running on the OnManagerPageInit event:
<?php
// check for 'edit_grid' permission and add to the ModExt permissions object
$gridEditPermission = $modx->hasPermission('doodles.edit_grid') ? 1 : 0;
$modx->regClientStartupHTMLBlock('<script type="text/javascript">
Ext.onReady(function() {
MODx.perm.edit_grid = '.$gridEditPermission.';
});
</script>');
In your ExtJS code, you can check for permissions like this:
,getMenu: function() {
var menu = [];
if (MODx.perm.edit_grid) {
menu = [{
text: _('doodles.doodle_update')
,handler: this.updateDoodle
},'-',{
text: _('doodles.doodle_remove')
,handler: this.removeDoodle
}];
}
return menu;
}