You should have your design like this:
1. Suppose your product page has 2 buttons
2. Purchase button - For common user
3. Ship item button - For admin
4. Now showing this button should not be dependent on whether user is admin or not, but on whether u want to show that component that page
you should have PageModel
class which has 2 boolean attributes
boolean showPurchaseButton
boolean showShipButton
you should have only one template/page creation code.
In template class,
u should add components to page like this:
if(showPurchaseButton){
//add purchase button to template
}
if(showShipButton){
//add ship button to template
}
while creating page, you can populate PageModel depending on user like this:
//common user
PageModel model = new PageModel()
model.setshowPurchaseButton(true);
model.setshowShipButton(false);
//for admin user
PageModel model = new PageModel()
model.setshowPurchaseButton(false);
model.setshowShipButton(true);
//while creating your template pass this model to it.
This way u'll have flexibilty to add as many components to ur template.
and also debugging will become easy because , when populating values in page model, u'll get idea that what components u r showing for which user. this section of code will act as ur control panel.