Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
We are going to use the excellent UI-O-Matic as an admin on a multisite installation.
How do we go about and restrict content so that only editors from a specific site can admin certain content.
Well the only option you have now is to restrict access to the UI-O-Matic section (so it's either access to all or none).
What would the permissions options be that you need, I can look into adding a simple workflow (so that on the attribute you can specify if a certain member group has access or not)
Usertypes that is not member groups, but if you sketch your scenario I'll see if it's doable
Just check that the backenduser loggedin has access to a certain siteroot/nodeid would do.
We could add NodeId to the table.
So say you have table x and table y and user john and user jane, john would only need access to table x and jane to table y, something like that? So removing an entire tree based on the logged in user? Not sure I can make something generic, but could add an event model that would allow you to remove the node based on some rules (that you can specify)
Well, we want all users to have access to the tables.
Say we have a small bookingsystem with one table only.
In that table we only want John and Jane to see "their" content. And since they are "mapped" to SiteRoot XX they will only see content with SiteRootId XX.
Does this make sense? :-)
It does :) in this case you basically want to add an additional where statement to the sql query fetching the data
Again will try to do this with an event model so it's possible to have hook into stuff like these
Shouldn't be that hard, will get that done today/tomorrow
Ok just made a couple of changes that now add an event model, you should be able to attach to the following 2 events
As you can see in the code here https://github.com/TimGeyssens/UIOMatic/blob/master/src/UIOMatic/Controllers/PetaPocoObjectController.cs
They should allow you to manipulate the query before it's bein executed, thus adding your additional rules :)
I'll give your scenario a go tomorrow
Ok so this is now an example
public class EventHandlerscs: ApplicationEventHandler
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
UIOMatic.Controllers.PetaPocoObjectController.BuildingQuery += PetaPocoObjectController_BuildingQuery;
void PetaPocoObjectController_BuildingQuery(object sender, UIOMatic.QueryEventArgs e)
if (e.TableName == "ccpEvent")
e.Query.Where("AREAID = @0", 2);
You get the gist here? You'll need to filter on your table name first and then set the where on your SiteRootId, fetching that value in some way from your user...
Worked like a charm, thanks.
Now I just have to find out a way to get the "Start Node in Content" ID from Umbraco.
Jonas, if you found one, would you mind sharing your solution for grabbing the user's start node in this context?
e.Query.Where("SiteRootId = @0", UmbracoContext.Current.Security.CurrentUser.StartContentId);
Great :) thanks for confirming!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted