GroupBrowser: moveToGroup button always disabled #PL-2032

This commit is contained in:
Yuriy Artamonov 2013-04-10 13:23:28 +00:00
parent 63bcbd6f45
commit ec74d506d7

View File

@ -13,7 +13,6 @@ import com.haulmont.cuba.gui.components.*;
import com.haulmont.cuba.gui.components.actions.CreateAction;
import com.haulmont.cuba.gui.components.actions.EditAction;
import com.haulmont.cuba.gui.components.actions.ItemTrackingAction;
import com.haulmont.cuba.gui.data.DataSupplier;
import com.haulmont.cuba.gui.data.Datasource;
import com.haulmont.cuba.gui.data.HierarchicalDatasource;
import com.haulmont.cuba.gui.data.impl.DsListenerAdapter;
@ -35,9 +34,6 @@ import java.util.*;
*/
public class GroupBrowser extends AbstractWindow {
@Inject
protected DataSupplier dataSupplier;
@Inject
protected UserManagementService userManagementService;
@ -128,9 +124,9 @@ public class GroupBrowser extends AbstractWindow {
}
@Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled && userSession.isEntityOpPermitted(metadata.getSession().getClass(User.class),
EntityOp.UPDATE));
public boolean isApplicableTo(Datasource.State state, Entity item) {
return super.isApplicableTo(state, item) && userSession.isEntityOpPermitted(metadata.getSession().getClass(User.class),
EntityOp.UPDATE);
}
});
@ -247,4 +243,4 @@ public class GroupBrowser extends AbstractWindow {
super.actionPerform(component);
}
}
}
}