misc/migration/postcreate.py
branchstable
changeset 7780 a1d5365fefc1
parent 6427 c8a5ac2d1eaa
child 7782 40a49f4350a5
equal deleted inserted replaced
7779:3826d8480a68 7780:a1d5365fefc1
     1 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     1 # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 #
     3 #
     4 # This file is part of CubicWeb.
     4 # This file is part of CubicWeb.
     5 #
     5 #
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
    67             default = cfg.option_default(optname, optdict)
    67             default = cfg.option_default(optname, optdict)
    68             # only record values differing from default
    68             # only record values differing from default
    69             if value != default:
    69             if value != default:
    70                 rql('INSERT CWProperty X: X pkey %(k)s, X value %(v)s',
    70                 rql('INSERT CWProperty X: X pkey %(k)s, X value %(v)s',
    71                     {'k': key, 'v': value})
    71                     {'k': key, 'v': value})
    72 
       
    73 # add PERM_USE_TEMPLATE_FORMAT permission
       
    74 from cubicweb.schema import PERM_USE_TEMPLATE_FORMAT
       
    75 usetmplperm = create_entity('CWPermission', name=PERM_USE_TEMPLATE_FORMAT,
       
    76                             label=_('use template languages'))
       
    77 rql('SET X require_group G WHERE G name "managers", X eid %(x)s',
       
    78     {'x': usetmplperm.eid})