Skip to content

Commit 792b016

Browse files
committed
Bugfix to more actions button permissions
1 parent 73f8eb5 commit 792b016

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

LDK/api-src/org/labkey/api/ldk/table/SimpleButtonConfigFactory.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,17 @@ protected String getJsHandler(TableInfo ti)
125125
@Override
126126
public boolean isAvailable(TableInfo ti)
127127
{
128-
return _owner == null || ti.getUserSchema().getContainer().getActiveModules().contains(_owner);
128+
if (_owner != null && !ti.getUserSchema().getContainer().getActiveModules().contains(_owner))
129+
{
130+
return false;
131+
}
132+
133+
if (_permission != null && !ti.getUserSchema().getContainer().hasPermission(ti.getUserSchema().getUser(), _permission))
134+
{
135+
return false;
136+
}
137+
138+
return true;
129139
}
130140

131141
@Override

LDK/src/org/labkey/ldk/query/DefaultTableCustomizer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,11 @@ private static boolean configureMoreActionsBtn(TableInfo ti, List<ButtonConfigFa
469469
for (ButtonConfigFactory fact : buttons)
470470
{
471471
NavTree newButton = fact.create(ti);
472+
if (!fact.isAvailable(ti) || !fact.isVisible(ti))
473+
{
474+
continue;
475+
}
476+
472477
if (!btnNameMap.containsKey(newButton.getText()))
473478
{
474479
btnNameMap.put(newButton.getText(), newButton);

0 commit comments

Comments
 (0)