Setting rights for a user for Content access

Topics: Customizing Orchard, General
Sep 10, 2014 at 2:55 PM
Hi,

I want to link a part to user part so that for each user I can set rights for another content type.

I have a content type called Customer.
When I link the CustomerRightsPart to a user, I should see a list of Customers so that I can restrict some users from accessing customer data.

Is this possible?

I tried with a viewmodel but on submit, the TryUpdateModel does not work for the viewmodel and the information posted on saving the editor template is lost.

I have also tried n-n relationships as given in http://docs.orchardproject.net/Documentation/Creating-1-n-and-n-n-relations. But my usecase is to link a Customer content type to a user content type with extra information in a record table.

The record table should have fields like:
CustomerID, UserID, CanRead, CanUpdate

Any pointers on how to achieve this would help.

Thanks
Developer
Sep 15, 2014 at 3:04 AM
Edited Sep 15, 2014 at 3:04 AM
deeptim wrote:
Hi,

I want to link a part to user part so that for each user I can set rights for another content type.

I have a content type called Customer.
When I link the CustomerRightsPart to a user, I should see a list of Customers so that I can restrict some users from accessing customer data.

Is this possible?
Absolutely possible.
I tried with a viewmodel but on submit, the TryUpdateModel does not work for the viewmodel and the information posted on saving the editor template is lost.
You most likely made a mistake. Make sure that the keys of the posted FORM values match up with the properties of your view model. You could use the debugger to inspect the posted FORM keys and see if it should bind against your view model.