This repository was archived by the owner on Jan 28, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ pipeline {
8686
8787 " Plone5 & Python3" : {
8888 node(label : ' docker' ) {
89- sh ''' docker run -i --rm --name="$BUILD_TAG-plone5py3" -e GIT_BRANCH="$BRANCH_NAME" -e VERSIONS="validate-email=3.0.0rc2" -e ADDONS="$GIT_NAME[test]" -e DEVELOP="src/$GIT_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plone-test:5-python3 -v -vv -s $GIT_NAME'''
89+ sh ''' docker run -i --rm --name="$BUILD_TAG-plone5py3" -e GIT_BRANCH="$BRANCH_NAME" -e ADDONS="$GIT_NAME[test]" -e DEVELOP="src/$GIT_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plone-test:5-python3 -v -vv -s $GIT_NAME'''
9090 }
9191 }
9292 )
Original file line number Diff line number Diff line change 11Changelog
22=========
33
4+ 2.6 - (2021-04-09)
5+ ---------------------------
6+ * remove dependency on validate_email [dumitval]
7+ * re-allow NFPs to edit users from orgs of their country [dumitval]
8+
492.5 - (2021-01-09)
510---------------------------
611* remove NFP edit permission on "own country" users [dumitval]
Original file line number Diff line number Diff line change 1414from eea .ldapadmin import ldap_config
1515from eea .ldapadmin .ldap_config import _get_ldap_agent
1616from eea .ldapadmin .logic_common import _is_authenticated
17+ from eea .ldapadmin .ui_common import nfp_can_change_user
1718from eea .userseditor .permissions import EIONET_EDIT_USERS
1819from eea .userseditor .users_editor import load_template
1920from ldap import SCOPE_BASE
@@ -153,6 +154,14 @@ def can_edit_users(self):
153154
154155 return bool (user .has_permission (EIONET_EDIT_USERS , self .context ))
155156
157+ def can_edit_user (self , uid ):
158+ """ check the the authenticated user can edit a specific user
159+ This can mean he has the edit users permission or is an NFP and the
160+ target user is member of an organisation from the NFP's country """
161+ user = self .context .REQUEST .AUTHENTICATED_USER
162+ return (user .has_permission (EIONET_EDIT_USERS , self .context ) or
163+ nfp_can_change_user (self , uid , no_org = False ))
164+
156165 def can_view_roles (self ):
157166 """can_view_roles."""
158167 if not self .is_authenticated ():
Original file line number Diff line number Diff line change 1- 2.5
1+ 2.6
Original file line number Diff line number Diff line change @@ -18,11 +18,15 @@ class UserDetailsView(BrowserView):
1818 def __call__ (self ):
1919 REQUEST = self .request
2020 uid = REQUEST .form .get ('uid' )
21+ auth_user = REQUEST .AUTHENTICATED_USER
22+ is_auth = ('Authenticated' in auth_user .getRoles ())
2123
2224 if not uid :
23- # a missing uid can only mean this page is called by accident
24-
25- return
25+ if is_auth :
26+ uid = auth_user .getId ()
27+ else :
28+ # a missing uid can only mean this page is called by accident
29+ return
2630 date_for_roles = REQUEST .form .get ('date_for_roles' )
2731
2832 if "," in uid :
@@ -33,7 +37,6 @@ def __call__(self):
3337 multi = None
3438 user , roles = self .context ._prepare_user_page (uid )
3539
36- is_auth = ('Authenticated' in REQUEST .AUTHENTICATED_USER .getRoles ())
3740 # we can only connect to ldap with bind=True if we have an
3841 # authenticated user
3942 agent = self .context ._get_ldap_agent (bind = is_auth )
Original file line number Diff line number Diff line change 8585 <div xmlns:foaf="http://xmlns.com/foaf/0.1/"
8686 tal:attributes="about string:${common/portal_url}/users/${view/user/uid}" typeof="foaf:Person"
8787 tal:define="user view/user;
88+ uid user/uid;
8889 disabled python:user.get('status') == 'disabled';
8990 can_view_roles common/can_view_roles;
91+ can_edit_user python:common.can_edit_user(uid);
9092 can_edit_users common/can_edit_users;
9193 is_authenticated common/is_authenticated;">
9294
9395 <h1 property="foaf:name">
9496 <tal:block content="user/full_name" />
95- <a tal:condition="can_edit_users "
97+ <a tal:condition="can_edit_user "
9698 style="background:none"
9799 tal:attributes="href string:${common/portal_url}/eionet-account-tools/eionet_account_tools/users/edit_user?id=${user/uid}">
98100 <img src="/++resource++eea.userseditor-www/edit.gif" alt="Edit" />
102104 <div class="figure figure-right" style="clear: both"
103105 tal:condition="python:user['jpegPhoto'] and (not disabled or can_edit_users)">
104106 <div class="figure-image">
105- <a tal:attributes="href string:userphoto_jpeg?uid=${user/uid}" >
107+ <a>
106108 <img tal:attributes="src string:${common/base_url}/userphoto_jpeg?uid=${user/uid}" class="mouseclickpop"
107109 alt="photo of person" style="max-width:200px; max-height:150px" />
108110 </a>
Original file line number Diff line number Diff line change 2121 platforms = ['OS Independent' ],
2222 zip_safe = False ,
2323 install_requires = [
24- 'eea.usersdb>=1.3.40 ' ,
24+ 'eea.usersdb>=2.6 ' ,
2525 'deform' ,
2626 'phonenumbers' ,
2727 'six'
2828 ],
2929 extras_require = {
3030 'test' : [
31- 'eea.ldapadmin' ,
31+ 'eea.ldapadmin>=2.8 ' ,
3232 ],
3333 },
3434 )
You can’t perform that action at this time.
0 commit comments