Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

How to hide all user information in Administrator/ User Management #4518

LuongChu ·

Hello Pmease admin,
Due to security policy. We are required to hide all user information in Administrator/ User Management. I've checked and found that there are EntityDataTable is added in here
final EntityDataTable dataTable = new EntityDataTable("users", columns, provider, 20)
dataTable.addTopToolbar(new AjaxFallbackHeadersToolbar(dataTable, provider));
dataTable.addTopToolbar(new SearchNavToolbar(dataTable));
dataTable.addBottomToolbar(new SearchNavToolbar(dataTable));
add(dataTable);

with columns includes all user information field.
How can I hide all row data and keep column field only for user is display when user search in search bar.
Thank you for your support.

  • replies 4
  • views 1006
  • stars 0
steveluo ADMIN ·

@LuongChu

I'm not very understanding your question. Do you mean you want to hide the user rows like below:

empty-users.png

but can still show users when searching:

search-users.png

If you still allow search users, hiding user rows may be useless.

I also want to know do you want to modify the source code by yourself directly?

So please, let me know more about your question.

LuongChu ·

@steveluo
Thank you for your reply.
Yes, we want to hide user row and still show allowed user information when searching, that's the our security policy.
"I also want to know do you want to modify the source code by yourself directly?" --> This is our security policy so I think it is reasonable to modify by ourself instead of request doing by you.

steveluo ADMIN ·

Hi@LuongChu

Understand.

You can add a default criterion like below (about line #283):

final EntityProvider provider = new EntityProvider(User.class, new SortParam("name", true)) {

    @Override
    protected Criterion[] getCriterions() {
        List<Criterion> list = criterionsModel.getObject();

        // --------------------------------------------------------
        // Add a default criterion
        if (list.isEmpty()) {
            return new Criterion[] { Restrictions.lt("id", -1L) };
        }
        // --------------------------------------------------------

        return list.toArray(new Criterion[0]);
    }
};

Let me know if this is what you want.

LuongChu ·

@steveluo
I've checked and it works properly as our expectation.
Thank you very much for your support.