Hide columns to add/edit under userlevel condition (v2025)

I need help with something I need to do.
Without creating a view, how can I make it so that, depending on the user level, when they are in a table, they can only add certain columns?

Example:

User level 1 -> Table 1 -> Columns 1, 2, 3, 4, and 5
User level 2 -> Table 1 -> Columns 1, 3, and 5

In this example, both user levels can access the same table, and of the 5 columns, user level 2 can only add/edit columns 1, 3, and 5 (the others are hidden).

How can I do this?
v2025.12

You may use Page_DataRendering server event to set the Visible property of the fields, or the Field Visibility extension (for registered users).

But this event hide the columns in the table on list page, it is work the same on add/edit page?

You need to set up for the page you need. For example, for the List page, if you use Page_DataRendering, you should use that for the List page. If you use Field Visibility extension, you should set the visibility for the List page.

Well I didn't ask about list page, only add and edit page, but I tried with that and it works, so thank you.