Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
erp5
Commits
b61ddb75
Commit
b61ddb75
authored
Sep 13, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_certificate_authority: Prefer use Mixin them extend the class
This is simpler to manage and include extra methods
parent
b567c2d9
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
79 additions
and
13 deletions
+79
-13
bt5/erp5_certificate_authority/MixinTemplateItem/portal_components/mixin.erp5.PersonCertificateLoginMixin.py
...rtal_components/mixin.erp5.PersonCertificateLoginMixin.py
+61
-0
bt5/erp5_certificate_authority/MixinTemplateItem/portal_components/mixin.erp5.PersonCertificateLoginMixin.xml
...tal_components/mixin.erp5.PersonCertificateLoginMixin.xml
+10
-8
bt5/erp5_certificate_authority/PortalTypeTypeMixinTemplateItem/type_mixin.xml
..._authority/PortalTypeTypeMixinTemplateItem/type_mixin.xml
+3
-0
bt5/erp5_certificate_authority/bt/template_document_id_list
bt5/erp5_certificate_authority/bt/template_document_id_list
+1
-2
bt5/erp5_certificate_authority/bt/template_mixin_id_list
bt5/erp5_certificate_authority/bt/template_mixin_id_list
+2
-1
bt5/erp5_certificate_authority/bt/template_portal_type_type_mixin_list
...ificate_authority/bt/template_portal_type_type_mixin_list
+2
-1
bt5/erp5_certificate_authority/bt/template_tool_component_id_list
..._certificate_authority/bt/template_tool_component_id_list
+0
-1
No files found.
bt5/erp5_certificate_authority/
DocumentTemplateItem/portal_components/document.erp5_certificate_authority.Perso
n.py
→
bt5/erp5_certificate_authority/
MixinTemplateItem/portal_components/mixin.erp5.PersonCertificateLoginMixi
n.py
View file @
b61ddb75
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2023 Nexedi SA and Contributors. All Rights Reserved.
# Rafael Monnerat <rafael@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from
AccessControl
import
ClassSecurityInfo
,
Unauthorized
,
getSecurityManager
from
AccessControl
import
ClassSecurityInfo
,
Unauthorized
,
getSecurityManager
from
erp5.component.document.erp5_version.Person
import
Person
as
ERP5Person
from
Products.ERP5Type
import
Permissions
class
Person
(
ERP5Person
)
:
class
Person
CertificateLoginMixin
:
security
=
ClassSecurityInfo
()
security
=
ClassSecurityInfo
()
def
checkCertificateRequest
(
self
):
def
checkCertificateRequest
(
self
):
...
@@ -32,17 +59,3 @@ class Person(ERP5Person):
...
@@ -32,17 +59,3 @@ class Person(ERP5Person):
This API was kept for backward compatibility"""
This API was kept for backward compatibility"""
self
.
checkCertificateRequest
()
self
.
checkCertificateRequest
()
return
self
.
_generateCertificate
()
return
self
.
_generateCertificate
()
\ No newline at end of file
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getTitle'
)
def
getTitle
(
self
,
**
kw
):
"""
Returns the title if it exists or a combination of
first name and last name
"""
title
=
ERP5Person
.
getTitle
(
self
,
**
kw
)
test_title
=
title
.
replace
(
' '
,
''
)
if
test_title
==
''
:
return
self
.
getDefaultEmailCoordinateText
(
test_title
)
else
:
return
title
bt5/erp5_certificate_authority/
DocumentTemplateItem/portal_components/document.erp5_certificate_authority.Perso
n.xml
→
bt5/erp5_certificate_authority/
MixinTemplateItem/portal_components/mixin.erp5.PersonCertificateLoginMixi
n.xml
View file @
b61ddb75
...
@@ -2,27 +2,29 @@
...
@@ -2,27 +2,29 @@
<ZopeData>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<pickle>
<global
name=
"
Document
Component"
module=
"erp5.portal_type"
/>
<global
name=
"
Mixin
Component"
module=
"erp5.portal_type"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<dictionary>
<dictionary>
<item>
<item>
<key>
<string>
default_reference
</string>
</key>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
Person
</string>
</value>
<value>
<string>
Person
CertificateLoginMixin
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
de
scription
</string>
</key>
<key>
<string>
de
fault_source_reference
</string>
</key>
<value>
<value>
<none/>
<none/>
</value>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
description
</string>
</key>
<value>
<string>
document.erp5_certificate_authority.Person
</string>
</value>
<value>
<none/>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
portal_type
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
Document Component
</string>
</value>
<value>
<string>
mixin.erp5.PersonCertificateLoginMixin
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
sid
</string>
</key>
<key>
<string>
sid
</string>
</key>
...
@@ -44,7 +46,7 @@
...
@@ -44,7 +46,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
version
</string>
</key>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
_certificate_authority
</string>
</value>
<value>
<string>
erp5
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<key>
<string>
workflow_history
</string>
</key>
...
...
bt5/erp5_certificate_authority/PortalTypeTypeMixinTemplateItem/type_mixin.xml
View file @
b61ddb75
...
@@ -2,4 +2,7 @@
...
@@ -2,4 +2,7 @@
<portal_type
id=
"Certificate Login"
>
<portal_type
id=
"Certificate Login"
>
<item>
CertificateLoginMixin
</item>
<item>
CertificateLoginMixin
</item>
</portal_type>
</portal_type>
<portal_type
id=
"Person"
>
<item>
PersonCertificateLoginMixin
</item>
</portal_type>
</type_mixin>
</type_mixin>
\ No newline at end of file
bt5/erp5_certificate_authority/bt/template_document_id_list
View file @
b61ddb75
document.erp5.CaucaseConnector
document.erp5.CaucaseConnector
document.erp5_certificate_authority.Person
\ No newline at end of file
bt5/erp5_certificate_authority/bt/template_mixin_id_list
View file @
b61ddb75
mixin.erp5.CertificateLoginMixin
mixin.erp5.CertificateLoginMixin
mixin.erp5.PersonCertificateLoginMixin
\ No newline at end of file
bt5/erp5_certificate_authority/bt/template_portal_type_type_mixin_list
View file @
b61ddb75
Certificate Login | CertificateLoginMixin
Certificate Login | CertificateLoginMixin
Person | PersonCertificateLoginMixin
\ No newline at end of file
bt5/erp5_certificate_authority/bt/template_tool_component_id_list
deleted
100644 → 0
View file @
b567c2d9
tool.erp5.CertificateAuthorityTool
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment