It is an interesting case, sadly the validators can only access the value entered. To have access to the user, the view request object will need to be passed as well, to this method: https://gitlab.com/mayan-edms/mayan-edms/blob/master/mayan/apps/metadata/models.py#L115 and included in all the places it gets called. Open a ticket for follow up and to see if something can be done about this in the next version or with a custom app.
On Sunday, December 20, 2015 at 11:42:28 PM UTC-4, Magan wrote: > > > Hi, I've added a custom MetadataValidator for my app, and can use it fine. > > The problem I have is that a second MetadataValidator would need to check > the groups the logged in user belongs to. > > Cannot figure out how to pass the user object to the model Manager or to > the MetadataValidator, and I couldn't make it so far neither that way nor > accessing the SessionStore within the manager or the validator. > > Any suggestion? > > Thank you, > -- --- You received this message because you are subscribed to the Google Groups "Mayan EDMS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
