Part of canonical.launchpad.webapp.authentication View In Hierarchy
Implements interfaces: canonical.launchpad.webapp.interfaces.IPlacelessLoginSource
| Method | getPrincipal | Return an ILaunchpadPrincipal for the account with the given id. |
| Method | getPrincipals | Not implemented. |
| Method | getPrincipalByLogin | Return a principal based on the account with the email address |
| Method | _principalForAccount | Return a LaunchpadPrincipal for the given account. |
ILaunchpadPrincipal for the account with the given id.
Return None if there is no account with the given id.
The access_level can be used for further restricting the capability
of the principal. By default, no further restriction is added.
Similarly, when a scope is given, the principal's capabilities will
apply only to things within that scope. For everything else that is
not private, the principal will have only read access.
Note that we currently need to be able to retrieve principals for invalid People, as the login machinery needs the principal to validate the password against so it may then email a validation request to the user and inform them it has done so.
Get principals with matching names. See zope.app.pluggableauth.interfaces.IPrincipalSource
Return a principal based on the account with the email address signified by "login". :param want_password: If want_password is False, the pricipal will have None for a password. Use this when trying to retrieve a principal in contexts where we don't need the password and the database connection does not have access to the Account or AccountPassword tables. :return: None if there is no account with the given email address. The `access_level` can be used for further restricting the capability of the principal. By default, no further restriction is added. Similarly, when a `scope` is given, the principal's capabilities will apply only to things within that scope. For everything else that is not private, the principal will have only read access. Note that we currently need to be able to retrieve principals for invalid People, as the login machinery needs the principal to validate the password against so it may then email a validation request to the user and inform them it has done so.
The LaunchpadPrincipal will also have the given access level and scope.
If want_password is True, the principal's password will be set to the account's password. Otherwise it's set to None.