Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Pedro Mendes 21 posts 153 karma points
    Mar 15, 2018 @ 14:51
    Pedro Mendes
    0

    Filtering shown tables

    Hey there!

    I have a small issue with UI-O-Matic:

    I have several tables that are shown in the UI-O-Matic section and I need to have a user-specific or group-specific permission that could only see one of those tables. The remaining users/groups would be able to see all of them.

    I've searched and I only found this relevant topic that, sadly, tells me that it may not be possible to achieve what I want...

    ... or is it? wink :)

    Thanks,

    Pedro

  • Tim Geyssens 6419 posts 15020 karma points MVP 2x c-trib
    Mar 15, 2018 @ 15:04
    Tim Geyssens
    1

    Hi there, lets see if it's possible :) do you want to restrict the table data, or do you want to completely hide the tables from the tree?

  • Pedro Mendes 21 posts 153 karma points
    Mar 15, 2018 @ 15:13
    Pedro Mendes
    0

    Thanks for the reply Tim!

    Well, the perfect solution would be to hide the tables from the tree. Restricting the table data would be an acceptable solution, if the former is not possible xD

    Small example just to be clear:

    • 3 tables: tableA, tableB and tableC
    • 2 user groups, group1 and group2
    • group1 accesses ui-o-matic section, sees tableA tableB and tableC
    • group2 accesses ui-o-matic section and only sees tableB
  • Tim Geyssens 6419 posts 15020 karma points MVP 2x c-trib
    Mar 15, 2018 @ 15:14
    Tim Geyssens
    1

    Let me check if there are tree events you can hook into otherwise I can look into adding them

  • Tim Geyssens 6419 posts 15020 karma points MVP 2x c-trib
    Mar 15, 2018 @ 15:25
  • Pedro Mendes 21 posts 153 karma points
    Mar 15, 2018 @ 15:26
    Pedro Mendes
    0

    will give it a go!

    I'll say something afterwards :)

  • Tim Geyssens 6419 posts 15020 karma points MVP 2x c-trib
    Mar 15, 2018 @ 15:27
    Tim Geyssens
    100
    //register the event listener:
    TreeControllerBase.TreeNodesRendering += 
    TreeControllerBase_TreeNodesRendering;
    
    //the event listener method:
    void TreeControllerBase_TreeNodesRendering(TreeControllerBase sender, TreeNodesRenderingEventArgs e)
    {
        //this example will filter any content tree node whose node name starts with
    // 'Private', for any user that is of the type 'customUser'
    if (sender.TreeAlias == "content"
        && sender.Security.CurrentUser.UserType.Alias == "customUser")
    {
        e.Nodes.RemoveAll(node => node.Title.StartsWith("Private"));
    }
    }
    
  • Pedro Mendes 21 posts 153 karma points
    Mar 15, 2018 @ 15:39
    Pedro Mendes
    0

    Well Tim, you did it again! It worked like a charm :D

    I was so foccused on Ui-O-Matic itself that it never occured to me that I could use umbraco to get this working xD

    Now I only need to hide it from the dashboard and it's puuuuurfect!

    Thanks again! #H5YR

  • Tim Geyssens 6419 posts 15020 karma points MVP 2x c-trib
    Mar 15, 2018 @ 15:40
    Tim Geyssens
    1

    Great, glad I could help :)

Please Sign in or register to post replies

Write your reply to:

Draft