Page 1 of 1

Permission on admin

Posted: Mon Dec 03, 2012 12:15 pm
by denis
Hi,

I'm trying to hide a tab if the admin logged don't have the permission required. For now, i saw that is possible to hide a section or a complete module but i haven't seen an example to hide only an element in the view.

Below, what i have done in MyCustomerView :

Code: Select all

AdminUser loggedAdmin =  SecurityManager.USER;
if(loggedAdmin.getPermissions().contains("PERMISSION_ALL_ACCOUNT")){
   topTabSet.addTab(accountTab);
}


It works but is there an other mean to achieve that? Because if in permission management section we modify the name of this permission it will no longer work...

Re: Permission on admin

Posted: Mon Dec 03, 2012 2:40 pm
by phillipuniverse
There are currently no facilities to hide/show items on that granular of a level. A section is as granular as it gets out of the box for actually showing/hiding those items.

Re: Permission on admin

Posted: Mon Dec 03, 2012 3:12 pm
by denis
Ok thanks! I keep my solution In this case

Re: Permission on admin

Posted: Tue Dec 04, 2012 5:24 am
by denis
Hi,

Just for your information, i think that there is a problem in your permission management (BLC 2.1.0-SNAPSHOT) :

- if you create a new admin user and set only PERMISSION_ALL_CUSTOMER
- the module "Customer Care" and section "Customer" are correctly displayed. However when you click on customer section an error is showing up :

Image

I think that some references are missing in table blc_admin_permission_entity.

To fix the problem you have to add these rows :

Code: Select all

INSERT INTO BLC_ADMIN_PERMISSION_ENTITY (ADMIN_PERMISSION_ENTITY_ID, CEILING_ENTITY, ADMIN_PERMISSION_ID) VALUES (225, 'org.broadleafcommerce.common.locale.domain.Locale', 44);
INSERT INTO BLC_ADMIN_PERMISSION_ENTITY (ADMIN_PERMISSION_ENTITY_ID, CEILING_ENTITY, ADMIN_PERMISSION_ID) VALUES (226, 'org.broadleafcommerce.profile.core.domain.Country', 44);


Hope it can help you :-)

Re: Permission on admin

Posted: Fri Nov 07, 2014 9:55 am
by jasoneasterday
Is there a way just to hide a tab that we don't use such as the Media Tab on a Product?