when you add a page to resource group you need to add the resource group access in web context otherwise you cant access the page in frontend
That's definitely not the case. It's only true if you connect that resource group to a user group with a context of 'web'.
If all your Resource Group Access ACL entries have a context of 'mgr', they will have no effect in the front end of the site.
It is true, though, that the way to hide resources in the Manager from User A is to put them in a resource group and connect that resource group to a user group User A is not a member of.
It's also true that you can't protect individual resources, only resource groups.
That usually means putting all resources on the site into one resource group (I call it AllDocs) and connecting the AllDocs resource group to the Administrator user group with a Resource Group Access ACL entry with a context of 'mgr' and a policy of 'Resource'. That will hide all resources from users who are not in the Administrator group.
The DefaultResourceGroup plugin will put all new resources in a resource group for you automatically.
A simple snippet will put all existing resources in the group:
<?php
/* Put all resources in AllDocs group */
/* note: create the resource group first! */
$resources = $modx->getCollection('modResource');
$foreach ($resources as $resource) {
$resource->joinGroup('AllDocs');
$resource->save();
}
Then create a new resource group and user group for the resources the users *should* be able to see and connect them with a Context Access ACL entry as you did above with a context of 'mgr'.
None of this will affect things in the front end as long as the context is 'mgr' for all the ACL entries.
---------------------------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
MODX info for everyone:
http://bobsguides.com/modx.html