cubicweb #2920304 [security] add a security debugging tool [validation pending]

DBG_SECURITY & al.

def test_contract_config_update(self):
    with self.perm_checker() as t:
        from cubicweb.server import DBG_SEC, debugged, tunesecurity
        with debugged(DBG_SEC):
            with tunesecurity(items=('rolling_dates',),
                              capabilities=('update',)):
                ccf = t.efi(self.ccf)
                cc = ccf.reverse_commodity_config[0]
                cc.set_attributes(rolling_dates_offset=42)
                t.commit()

Would yield:

check_perm: 'update' 'attribute ContractConfig.rolling_dates_offset[Int]' [(ERQLExpression(Any X WHERE U has_update_permission X, X eid %(x)s, U eid %(u)s), {'eid': 2167}, True)]
prioritynormal
typeenhancement
appeared in<not specified>
done in3.18.0
load1.000
load left0.000
closed by#10006:1b549c1acd4f
patch