diff --git a/core/src/org/labkey/core/user/UserController.java b/core/src/org/labkey/core/user/UserController.java index 644bc6cb4e2..75fcb5dac0d 100644 --- a/core/src/org/labkey/core/user/UserController.java +++ b/core/src/org/labkey/core/user/UserController.java @@ -1587,11 +1587,10 @@ public ModelAndView getView(UserQueryForm form, BindException errors) if (schema == null) throw new NotFoundException(CoreQuerySchema.NAME + " schema"); - // use getTable(forWrite=true) because we hack on this TableInfo - // TODO don't hack on the TableInfo, shouldn't the schema check canSeeUserDetails() and has AdminPermission? - TableInfo table = schema.getTable(CoreQuerySchema.SITE_USERS_TABLE_NAME, null, true, true); + String tableName = isUserManager ? CoreQuerySchema.SITE_USERS_TABLE_NAME : CoreQuerySchema.USERS_TABLE_NAME; + TableInfo table = schema.getTable(tableName, null, true, true); if (table == null) - throw new NotFoundException(CoreQuerySchema.SITE_USERS_TABLE_NAME + " table"); + throw new NotFoundException(tableName + " table"); else if (table instanceof AbstractTableInfo) { // conditionally remove the email and groups columns only for this view