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...
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
//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"));
}
}
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
Comment author was deleted
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?
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:
Comment author was deleted
Let me check if there are tree events you can hook into otherwise I can look into adding them
Comment author was deleted
Can you try if these snippets work https://our.umbraco.org/documentation/extending/section-trees/trees-v7
will give it a go!
I'll say something afterwards :)
Comment author was deleted
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
Comment author was deleted
Great, glad I could help :)
is working on a reply...