locked
how to prevent some users .... RRS feed

  • Question

  • Hello All,

    i'm working on a project which will be used by many users.  i have to prevent some users from using some submenu items while some submenu item he can used

    how can i approach this?


    thanx in advance




    with best regards,

    Naeem Akhtar
    Tuesday, October 14, 2008 1:38 PM

Answers

  • Create a Boolean setting Scoped to User defaulted as False, and then at startup set that value to True if the user should be able to access those menu items.  Within the form you then set PropertySettings for Enabled or Visible (whatever you want) specific to the Setting you created.  So after it's set up, the program will run, set the Boolean value depending on if they are authorized or not, then the program will "automatically" enable/disable or visible/invisible the control you have set up.
    • Marked as answer by Naeem Akhtar Tuesday, October 14, 2008 1:55 PM
    Tuesday, October 14, 2008 1:45 PM

All replies

  • Create a Boolean setting Scoped to User defaulted as False, and then at startup set that value to True if the user should be able to access those menu items.  Within the form you then set PropertySettings for Enabled or Visible (whatever you want) specific to the Setting you created.  So after it's set up, the program will run, set the Boolean value depending on if they are authorized or not, then the program will "automatically" enable/disable or visible/invisible the control you have set up.
    • Marked as answer by Naeem Akhtar Tuesday, October 14, 2008 1:55 PM
    Tuesday, October 14, 2008 1:45 PM
  • hi mcelrogr,

    thanx a lot for ur post.

    ur post will be helpful, if possible is there any other way to do this?


    thanx again

    with best regars, 

    Naeem Akhtar
    Tuesday, October 14, 2008 1:54 PM
  • You could manually go through at startup and set the values for each menu item, but using PropertySettings requires less programing because it can be done in design (causing the code to be automatically created).
    Tuesday, October 14, 2008 3:02 PM
  • hi mcelrogr,

    thanx a lot for ur post.




    with best regars, 

    Naeem Akhtar
    Monday, October 20, 2008 11:22 AM