Alpha Video Training
Results 1 to 5 of 5

Thread: Custom menus based on User Rights

  1. #1
    Member
    Real Name
    Dave Classick Jr
    Join Date
    Feb 2006
    Posts
    112

    Default Custom menus based on User Rights

    Is it possible to have different menu/toolbars for different user access levels?

    IE if someone logs in as sales, they would have sales specific menus, and only be allowed to view/access certain tables

    If someone logs in as Admin, they have a completely different more robust set of options on the menu bar.

    so far i have created a custom menu, but everyone can see it.


    any help?

  2. #2
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default Re: Custom menus based on User Rights

    Haven't done this myself, but the Index entries for Menu in the Help file includes an item that looks promising:

    Changing Custom Menus and Toolbars at Runtime

    Time spent using the help system will help you find things easier and easier.

    --tom

  3. #3
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,212

    Default Re: Custom menus based on User Rights

    Quote Originally Posted by Classick
    Is it possible to have different menu/toolbars for different user access levels?

    IE if someone logs in as sales, they would have sales specific menus, and only be allowed to view/access certain tables

    If someone logs in as Admin, they have a completely different more robust set of options on the menu bar.

    so far i have created a custom menu, but everyone can see it.

    any help?
    Dave,
    I would imagine you could set up Form OnActivate events using toolbar.open() and toolbar.close() actions that are conditional to a Adminlevel established at the time of login. Or toolbars as objects on the form with hide() and show() conditional on Admin level.

    I would consider a single script run from each form instead of building all the admin level a script within each form, but that might get tricky with the need for Form pointers (Var_P<formnames> ). Also, I am thinking that the script should write to a variable the name of the toolbar active for the script to to close as an OnExit event. I couldn't find a toolbar_get() function that could return the name of the active toolbar. And since it appears that the toolbar remains open even after closing the database, then you are going to have to close the toolbars with an OnExit form event.

    ONACTIVATE:
    if loginlevel = 1 then
    TBactive = "toolbar 1" ' this is the toolbar name
    else if loginlevel = 2 then
    TBactive = "toolbar 2"
    end if

    dim ptr as P
    ptr = toolbar.open(Var->TBactive)

    ONEXIT:
    dim ptr as P
    ptr = toolbar.open(Var->TBactive)
    ptr.close()

    I'm sure there is something more exotic but just some prelim thoughts.

    Mike W

  4. #4
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default Re: Custom menus based on User Rights

    It's also possible to enable or disable menu items.

    Code:
    <OBJECT>.MENUITEMENABLE()
    -- tom

  5. #5
    Member
    Real Name
    Dave Classick Jr
    Join Date
    Feb 2006
    Posts
    112

    Default Re: Custom menus based on User Rights

    If i were to have differerent menu's created for each specific user access, at what point in time does Alpha decide which menubar to load?

    i have a custom menubar that loads now, but can it be conditional, as in loaded from Autoexec?

Similar Threads

  1. Client Login with limited user rights
    By Jared Sutherland in forum Web Application Server v6
    Replies: 4
    Last Post: 05-10-2005, 07:07 PM
  2. User Rights Required for Table Updating
    By Red Abicht in forum Alpha Five Version 4
    Replies: 1
    Last Post: 09-11-2003, 03:42 AM
  3. How do I create custom menus?
    By ShawnWhite in forum Alpha Five Version 5
    Replies: 2
    Last Post: 08-06-2003, 10:54 PM
  4. Custom Menus
    By mel in forum Alpha Five Version 5
    Replies: 1
    Last Post: 11-02-2002, 09:23 AM
  5. Custom Dropdown Menus
    By David Priest in forum Alpha Five Version 4
    Replies: 1
    Last Post: 06-23-2002, 06:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •