Disable insert, update,delete in a form for certain usergroup(Security)

Hi!

The question touches both Form and Security module of SC. I have SC’s security module up and running but now i need to create a usergroup with the users unable to Insert, update,delete the records into the db but can view the records.

I read a thread where Diogo said that:
“You can do more deep … if is a form application, you can choose if the user can delete, update or delete, using sc_apl_conf to enable or disable the application option dynamically.”

But i have no idea where and how can i do it.
Any ideas?
Thanks!

Re: Disable insert, update,delete in a form for certain usergroup(Security)

you’l need to change the database structure to allow when you create the new usergroup, to choose if the buttons insert/update/delete will be disable. Just create a new field on the database.

At the login application, see where is the select to the user group, add this new field to the select statement and use sc_apl_conf after selecting the applications that the user has access to enable or disable to buttons.

ex:


sc_lookup(rs, "SELECT applicationId FROM accessLevel_x_applications WHERE accessLevelId = '".{dataset[0][3]} . "'");

 if(isset({rs[0][0]}))
 {
  foreach({rs} as $apl)
  {
   sc_apl_status ($apl[0], 'on');

   //you need to get this variable at the usergroup select ....
   if($usergroup_disable_form_buttons == 'Y')
   {
     sc_apl_conf("my_form", "insert", "off");
     sc_apl_conf("my_form", "update", "off");
     sc_apl_conf("my_form", "delete", "off");
   }
  }
 }

Re: Disable insert, update,delete in a form for certain usergroup(Security)

Hi Diogo!
Thanks a lot for your reply.

However i didn’t understand exactly,

1)“Just create a new field on the database.”
–>In which table? i have five tables related to security, don’t know if it helps but here are the table names: user, user_group, gropus, applications, groups_applications.

2)At the login application, see where is the select to the user group, add this new field to the select statement and use sc_apl_conf after selecting the applications that the user has access to enable or disable to buttons.
–>Which application in Sc’s security module? there is one grid_groups but i am not sure if you are talking about that.

Would be really a great help if someone could comeup with tutorial on this one.

Thanks!

Re: Disable insert, update,delete in a form for certain usergroup(Security)

  1. If you want a group to have this options, then you need to create this field in the group table.
  2. Login is the application that checks if the user exists and if the password is ok, so you need to change the login. Check the logins events …

Re: Disable insert, update,delete in a form for certain usergroup(Security)

Ok.

Thanks for explaining. I will try it out.