Functional overview
This feature is provided by 'project_certification' plugin.
There are no functional changes, this story allows to system administrators to deploy custom code that will be called each and everytime a project owner is selected.
Technical overview
The code will be deployed in /etc/tuleap by system administrators.
It will be called:
- At project creation to ensure the one who create the project can be a project owner
- On project owner change in site administration to list only potentially valid project owners
The first code will ensure that a given user is allowed to be a owner of a given project. The interface will looks like
/**
* @ return boolean
*/
public function isUserAllowedToBeOwner(PFUser $user);
The second method will find a user to step over the one that can no longer be owner
/**
* @return PFUser | null
*/
public function getUserToReplaceOwner(PFUser $user);
In order to reduce risks of regressions due tu internal API usage, the called custom object will be given its dependencies with dependency injection in the constructor. The following code exposes the global idea:
public function __construct(UserRetriever $user_retreiver, LDAPFetcher $ldap_fetcher);
UserRetriever and LDAPFetcher will be 2 new interfaces that exposes the internal tuleap API that are being used by the custom code. This will help Tuleap developers to warn custom code users about API changes from one release to another. This also means that custom code implementors must only used injected objects in order to guarranty the forward compatibility.