[Cubicweb] How to customize permissions on relations ?

Aurélien Campéas aurelien.campeas at logilab.fr
Tue Jan 7 15:52:18 CET 2014


On 07/01/2014 15:32, Yann Cointepas wrote:
> If I have access to the RelationDefinition derived class, can I reach
> the RelationType and modify the permission there ?

You can probably:

from cubes.comment import schema
del schema.comments.__permission__

> 
> I will not use comment in my cube, I could just skip it. But I cannot
> use try/catch in schema.py because the error is raised later (unless I
> am wrong). Can I detect relation definition with permissions customized
> on relation type ?

Well, if you don't use comment, then what's the point
of putting permissions on the comments relation ... ?


> 
> Before posting my question, I searched internet with the error message
> and found a piece of code (not working) where set_permissions had a
> reset=True parameter. Could it be a solution to allow a user to say : "I
> really want to override permissions" ?
> 

No, set_permissions is a workflow object method and is
not related to your problem.

Regards,
Aurélien.





More information about the Cubicweb mailing list