This topic is locked
[SOLVED]

 Hide Columns based on user groups

5/18/2012 3:59:07 PM
PHPRunner General questions
milsimcorps author

I have checked but I can not find it. I am using PHPRunner 6.1 and I would like to hide a specific column based on multiple user groups (Admin, Members, Teams Captain, Guest, Default). In the Edit, Add, List and the Page Views. I think this is a great way to reducing the number custom views.
e.g. 1) If groups from the Admin, Members or Teams Captain are viewing TABLE: Registered Members, in the "List" or "Page" View, they can see COLUMN: A. If they are from the Group Default or Guest, they can not see COLUMN: A.
e.g.2) As a Member Group they can not view, edit or add data in Column A of the TABLE: Registered Members.

P
procheck 5/22/2012

Did you see this section in the manual? It's under "Advanced topics/Events/Sample Events/Appearance".
Hide controls on Add/Edit pages, based on logged user name

milsimcorps author 5/25/2012



Did you see this section in the manual? It's under "Advanced topics/Events/Sample Events/Appearance".
Hide controls on Add/Edit pages, based on logged user name


Thank you for your quick response and assistance. But for some reason it is not working for me. I am trying to hide the column in the list view of the Teams Members Table.
I am getting the following error message (see image).
What I did was place the code:
$xt->assign("[color="#FF0000"]status_fieldblock",$_SESSION["AccessLevel"]== ACCESS_LEVEL_Captains);
in the List page event: "Before display"

Sergey Kornilov admin 5/26/2012

There are only two access level, user and admin. ACCESS_LEVEL_Captains do not exist. Use something else like $_SESSION["UserID"] or $_SESSION["GroupID"] for this purpose.