diff --git a/product/ERP5/ERP5Site.py b/product/ERP5/ERP5Site.py index 51fcb41aa830d9c9e3fa6d52c0c2d22db5dbede5..c5ebdc747f5cc77c66d86a842a67cca81a5f679e 100644 --- a/product/ERP5/ERP5Site.py +++ b/product/ERP5/ERP5Site.py @@ -1268,6 +1268,21 @@ class ERP5Site(FolderMixIn, CMFSite): key = ('default_activate_parameter', ) return tv.get(key) + security.declareProtected(Permissions.ManagePortal, 'getERP5SiteGlobalId') + def getERP5SiteGlobalId(self): + """Returns site global ID without any fallback""" + return getattr(self, 'erp5_site_global_id', None) + + security.declareProtected(Permissions.ManagePortal, 'setERP5SiteGlobalId') + def setERP5SiteGlobalId(self, global_id): + """Sets site global ID, only in case if not set yet + + Such id should be very big and random, for example uuid version 4, as + defined in RFC 4122. + """ + if self.getERP5SiteGlobalId() in [None, '']: + self.erp5_site_global_id = global_id + Globals.InitializeClass(ERP5Site) def getBootstrapDirectory():