use of com.haulmont.cuba.gui.app.security.role.edit.UiPermissionValue in project cuba by cuba-platform.
the class DesktopTabSheet method applyPermission.
@Override
public void applyPermission(UiPermissionDescriptor permissionDescriptor) {
Preconditions.checkNotNullArgument(permissionDescriptor);
final String subComponentId = permissionDescriptor.getSubComponentId();
final TabSheet.Tab tab = getTab(subComponentId);
if (tab != null) {
UiPermissionValue permissionValue = permissionDescriptor.getPermissionValue();
if (permissionValue == UiPermissionValue.HIDE) {
tab.setVisible(false);
} else if (permissionValue == UiPermissionValue.READ_ONLY) {
tab.setEnabled(false);
}
} else {
LoggerFactory.getLogger(DesktopTabSheet.class).info(String.format("Couldn't find component %s in window %s", subComponentId, permissionDescriptor.getScreenId()));
}
}
Aggregations