The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
R/W Access to control only for specific users
Posted: 19 Sep 07 2:51 PM
|
We have several checkboxes that only certain users are allowed to "touch". All others see them as R/O. They way I do it is create a custom Security Profile with R/W to the field that corresponds to the checkbox. But it is somewhat inconvenient, since we are adding more controls like this and each one has different users assigned to it. That means I have to create a separate Security Profile for each and then maintain them, making sure any general changes are applies to all profiles. Is there any easier way to give access to certain controls ONLY to specified users? Will that have to be in code using user's DB ID?
Thanks
|
|
|
|
Re: R/W Access to control only for specific users
Posted: 20 Sep 07 9:16 AM
|
Other than using security profiles, the only way I know of to do that would be to define which controls are writable via code as you mention. Although, I think the only real benefit of doing it in code is that you would be able to define everything in one script, rather than deal will numerous security profiles. If access is different for each individual user, your case statement could get pretty unwieldy based on how many individual users you have to set up.
For example: (On whenchange event of the form)
chkBoxA.Enabled = False chkBoxB.Enabled = False chkBoxC.Enabled = False
Select Case Application.Basicfunctions.CurrentUserID
Case "xxxxxxxxxxx1" chkBoxA.Enabled = "True" Case "xxxxxxxxxxx2" chkBoxB.Enabled = "True" Case "xxxxxxxxxxx3" chkBoxC.Enabled = "True" etc...
End Select
If you can break it up by teams, it would be a little more manageable. (team1 has access to checkboxes 1, 2, 3; team 2 has access to checkboxes 4, 5, 6, for example...) You would have to write a function to determine if a user is a member of a particular team, but that's not to difficult.
You could do somthing like: (Assuming you write a function called IsTeamMember which you pass the current UserID along with the Team name, which would return either True or False)
Dim sUserID
sUserID = Application.BasicFunctions.CurrentUserID
If IsTeamMember(sUserID, "TeamName1") Then chkBoxA.Enabled = True chkBoxB.Enabled = True End If
If IsTeamMember(sUserID, "TeamName2") Then chkBoxC.Enabled = True chkBoxD.Enabled = True End If
etc...
Not sure if this helps. Hopefully, it will give you some ideas at least. |
|
|
| |
| |
| |
| |
| |
| |
| |
|
Re: R/W Access to control only for specific users
Posted: 02 Jul 14 4:56 PM
|
holy cow Ryan, that is one of the easiest and most powerful things I have yet to do in SLX. It worked like a champ!!!! thank you to you and all the other folks on here who share their knowledge. |
|
|
|