diff --git a/bt5/erp5_administration/SkinTemplateItem/portal_skins/erp5_administration/Base_viewSecurity.py b/bt5/erp5_administration/SkinTemplateItem/portal_skins/erp5_administration/Base_viewSecurity.py index 68c5619ed1ab938f795c177f2cf1d1ffe885d153..b2fc6dee0eec3cdbcd30e7fdb2c8a6d93af97658 100644 --- a/bt5/erp5_administration/SkinTemplateItem/portal_skins/erp5_administration/Base_viewSecurity.py +++ b/bt5/erp5_administration/SkinTemplateItem/portal_skins/erp5_administration/Base_viewSecurity.py @@ -6,18 +6,18 @@ u = getSecurityManager().getUser() user_value = u.getUserValue() if user_value is None: - print 'User ID:', u.getId() + print('User ID: %s' % u.getId()) else: - print 'User ID:', u.getId(), user_value.getPath() + print('User ID: %s %s' % (u.getId(), user_value.getPath())) login_value = u.getLoginValue() if login_value is None: - print 'Login:', u.getUserName() + print('Login: %s' % u.getUserName()) else: - print 'Login:', u.getUserName(), login_value.getPath() -print 'Is owner:', u.allowed(context,('Owner',)) -print 'User roles:', u.getRoles() -print 'User roles in context:', u.getRolesInContext(context) -print 'Permissions:' + print('Login: %s %s' % (u.getUserName(), login_value.getPath())) +print('Is owner: %s' % u.allowed(context,('Owner',))) +print('User roles: %s' % u.getRoles()) +print('User roles in context: %s' % u.getRolesInContext(context)) +print('Permissions:') for permission in [ 'Access contents information', 'Add portal content', @@ -26,25 +26,25 @@ for permission in [ 'View', 'Manage portal', ]: - print " ", permission, u.has_permission(permission, context) + print(" %s %s" % (permission, u.has_permission(permission, context))) -print +print('') try: - print "User groups:\n", pformat(sorted(u.getGroups())) + print("User groups:\n%s" % pformat(sorted(u.getGroups()))) except AttributeError: - print 'no getGroups' + print('no getGroups') -print -print 'Local roles on document:\n', pformat(context.get_local_roles()) +print('') +print('Local roles on document:\n%s' % pformat(context.get_local_roles())) -print ''' +print(''' ---------------- Security mapping -----------------''' +----------------''') if u.getId() is not None: try: - print context.Base_viewSecurityMappingAsUser(u.getId()) + print(context.Base_viewSecurityMappingAsUser(u.getId())) except Unauthorized: - print "user doesn't have permission to security mapping in this context" + print("user doesn't have permission to security mapping in this context") return printed diff --git a/bt5/erp5_administration/SkinTemplateItem/portal_skins/erp5_administration/Base_viewSecurityMappingAsUser.py b/bt5/erp5_administration/SkinTemplateItem/portal_skins/erp5_administration/Base_viewSecurityMappingAsUser.py index 91ecce1392ab74f39ba917a2a1b17ad879f9cf03..87dbb99079655fa5dcbebf065f1b66686c42d8bb 100644 --- a/bt5/erp5_administration/SkinTemplateItem/portal_skins/erp5_administration/Base_viewSecurityMappingAsUser.py +++ b/bt5/erp5_administration/SkinTemplateItem/portal_skins/erp5_administration/Base_viewSecurityMappingAsUser.py @@ -16,12 +16,12 @@ for method_id, base_category_list in getSecurityCategoryMapping(): security_category_dict.setdefault(tuple(base_category_list), []).extend( getattr(context, method_id)(base_category_list, login, context, '')) except Exception: # XXX: it is not possible to log message with traceback from python script - print 'It was not possible to invoke method %s with base_category_list %s'%(method_id, base_category_list) + print('It was not possible to invoke method %s with base_category_list %s'%(method_id, base_category_list)) for base_category_list, category_value_list in security_category_dict.items(): - print 'base_category_list:', base_category_list + print('base_category_list: %s' % (base_category_list,)) for category_dict in category_value_list: - print '-> category_dict:', category_dict - print '-->', group_id_list_generator(category_order=base_category_list, - **category_dict) + print('-> category_dict: %s' % category_dict) + print('--> %s' % group_id_list_generator(category_order=base_category_list, + **category_dict)) return printed