Alpha Video Training
Results 1 to 4 of 4

Thread: Hide/show linked grid based on security group. How To?

  1. #1
    Member cptutrecht's Avatar
    Real Name
    Ger Kurvers
    Join Date
    Feb 2010
    Location
    Netherlands, Utrecht
    Posts
    525

    Question Hide/show linked grid based on security group. How To?

    I have been searching for an option to show some of the linked grids only for certain usersgroups. Could't find such an option (or did i overlooked it?)
    Can it be done programmatically in a5web? Did somebody already figure it out and is willing to share the code?

    Thanks in advance
    Ger Kurvers

  2. #2
    "Certified" Alphaholic
    Real Name
    eric
    Join Date
    Mar 2009
    Location
    Amsterdam
    Posts
    1,284

    Default Re: Hide/show linked grid based on security group. How To?

    Ger,
    I found this on the board from a other member I believe Drake?
    We say thanks .
    This will work as a workaround with the A5 security.
    Hope in time i's easier and standard in A5.

    The Code :

    DIM nextRow as N = 0
    DIM delArry[1] as N
    DIM arrCountZ as N = 0
    DIM q as N = 0
    DIM mygroup as C = crlf_to_comma(a5ws_get_user_assignments(session.__protected__ulink,request))
    delArry[1] = 0

    'This is a custom function I use for security
    'any logic can be placed here

    if is_one_of("hrm_verlof",mygroup) = .T. then
    'if is_one_of("test",mygroups) = .T. then
    then
    'Do Nothing
    else
    delArry[] = tmpl.RowExpandGrids.find("Dossier","TabLabel")
    end if

    if delArry[1] > 0 then
    for q = 1 to delArry.size() step 1
    arrCountZ = (tmpl.RowExpandGrids.size() - 1)
    if arrCountZ <> q
    for x = q to arrCountZ step 1
    nextRow = x + 1
    tmpl.RowExpandGrids[x].gridName = tmpl.RowExpandGrids[nextRow].gridName
    tmpl.RowExpandGrids[x].linkFields = tmpl.RowExpandGrids[nextRow].linkFields
    tmpl.RowExpandGrids[x].hideLinkFields = tmpl.RowExpandGrids[nextRow].hideLinkFields
    tmpl.RowExpandGrids[x].inheritParentStyle = tmpl.RowExpandGrids[nextRow].inheritParentStyle
    tmpl.RowExpandGrids[x].OverrideSettings = tmpl.RowExpandGrids[nextRow].OverrideSettings
    tmpl.RowExpandGrids[x].TabLabel = tmpl.RowExpandGrids[nextRow].TabLabel
    next
    end if

    if arrCountZ >= 0 then
    tmpl.RowExpandGrids.resize(arrCountZ)
    end if
    next
    end if

    Put it in the Grid Advanced properties.
    Also read that Steve had the same question, advice from Selwyn to stuff it in the watch event client side.

    Groet,

    Eric

  3. #3
    Member cptutrecht's Avatar
    Real Name
    Ger Kurvers
    Join Date
    Feb 2010
    Location
    Netherlands, Utrecht
    Posts
    525

    Default Re: Hide/show linked grid based on security group. How To?

    Hello Eric,

    Thanks to the creator (Drake?) and to you for quick response.
    I'm curious what will happen sooner: me understanding the code or A5 guys creating a standard option for it....:-)

    I know another option: creation different versions of pages/grids for different groups (in my case there won't be a lot of combinations needed). But i really hate such redundancy in programming...


    Groet,
    Ger

  4. #4
    "Certified" Alphaholic
    Real Name
    eric
    Join Date
    Mar 2009
    Location
    Amsterdam
    Posts
    1,284

    Default Re: Hide/show linked grid based on security group. How To?

    Ger,

    For know it's a solution/work around, When THE standard is ready simple wait, it takes two to make a tango. Selwyn has open ear for good questions, Great Guy !!

    A5 R&D team there hard working guys, never seen that on a product before.

    Last month there was hard labor in R&D some questions I had about the date picker where solved in a glance, that is specialy for us dutchies important for our customers but service to the hole A5 community.

    creation different versions of pages/grids for different groups --> advice use the workaround

    my2Euros

    Eric

Similar Threads

  1. show/hide tabs in linked Content
    By Steve Wood in forum Application Server Version 10 - Web/Browser Applications
    Replies: 13
    Last Post: 03-09-2011, 04:06 PM
  2. Show/Hide Frame within a Grid
    By den1s in forum Application Server Version 9 - Web/Browser Applications
    Replies: 0
    Last Post: 11-06-2009, 12:19 PM
  3. Show/Hide in Dialog based on session variable
    By Tommy Thompson in forum Application Server Version 9 - Web/Browser Applications
    Replies: 4
    Last Post: 09-19-2008, 06:50 PM
  4. Conditional SHOW/HIDE in GRID
    By den1s in forum Application Server Version 8
    Replies: 4
    Last Post: 02-21-2008, 10:09 PM
  5. Replies: 0
    Last Post: 06-13-2007, 05:53 AM

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
  •