def update(self,req,body,id=None): environ = req.environ self.db_session=environ['db_session'] context=environ['hydrogen.context'] action="update_argtype" try: target=SvTarget.factory().to_dict() except Exception,e: return e.msg
def getAllPolicyInfo(self,req): environ = req.environ self.db_session=environ['db_session'] context=environ['hydrogen.context'] action="getallpolicyinfo" target=SvTarget.factory().to_dict() policy.init() try: policy.enforce(context, action, target) except Exception,e: return e.msg
def create(self,req,body=None): environ = req.environ user_id = environ['HTTP_X_USER_ID'] user_name = environ['HTTP_X_USER_NAME'] self.db_session=environ['db_session'] # need to upgrade to use permission engine #验证权限 context=environ['hydrogen.context'] action="deploy_service" target=SvTarget.factory().to_dict() policy.init() try: policy.enforce(context, action, target) except Exception,e: return e.msg