l.r.i.p.IPersonEditRestricted(Interface) : interface documentation

Part of lp.registry.interfaces.person View In Hierarchy

Known subclasses: lp.registry.interfaces.webservice.IPerson

IPerson attributes that require launchpad.Edit permission.
Method join Join the given team if its membership_policy is not RESTRICTED.
Method leave Leave the given team.
Method setMembershipData Set the attributes of the person's membership on this team.
Method addMember Add the given person as a member of this team.
Method acceptInvitationToBeMemberOf Accept an invitation to become a member of the given team.
Method declineInvitationToBeMemberOf Decline an invitation to become a member of the given team.
Method retractTeamMembership Retract this team's membership in the given team.
Method renewTeamMembership Renew the TeamMembership for this person on the given team.
Method security_field_changed Trigger email when a secured field like preferredemail changes.
Method createPPA Create a PPA.
@call_with(REQUEST_USER)
@operation_parameters(copy_field(ITeamMembership['team']))
@export_write_operation()
@operation_for_version('beta')
def join(team, requester=None, may_subscribe_to_list=True):
Join the given team if its membership_policy is not RESTRICTED.

Join the given team according to the policies and defaults of that team:

  • If the team membership_policy is OPEN, the user is added as an APPROVED member with a NULL TeamMembership.reviewer.
  • If the team membership_policy is MODERATED, the user is added as a PROPOSED member and one of the team's administrators have to approve the membership.

If may_subscribe_to_list is True, then also attempt to subscribe to the team's mailing list, depending on the list status and the person's auto-subscribe settings.

ParametersrequesterThe person who requested the membership on behalf of a team or None when a person requests the membership for themselves.
may_subscribe_to_listIf True, also try subscribing to the team mailing list.
@operation_parameters(copy_field(ITeamMembership['team']))
@export_write_operation()
@operation_for_version('beta')
def leave(team):
Leave the given team.

This is a convenience method for retractTeamMembership() that allows a user to leave the given team, or to cancel a PENDING membership request.

ParametersteamThe team to leave.
def setMembershipData(person, status, reviewer, expires=None, comment=None):
Set the attributes of the person's membership on this team.

Set the status, dateexpires, reviewer and comment, where reviewer is the user responsible for this status change and comment is the comment left by the reviewer for the change.

This method will ensure that we only allow the status transitions specified in the TeamMembership spec. It's also responsible for filling/cleaning the TeamParticipation table when the transition requires it.

@call_with(REQUEST_USER)
@operation_parameters(copy_field(ITeamMembership['person']), copy_field(ITeamMembership['status']), Text(False))
@export_write_operation()
@operation_for_version('beta')
def addMember(person, reviewer, status=TeamMembershipStatus.APPROVED, comment=None, force_team_add=False, may_subscribe_to_list=True):
Add the given person as a member of this team.
ParameterspersonIf the given person is already a member of this team we'll simply change its membership status. Otherwise a new TeamMembership is created with the given status.
reviewerThe user who made the given person a member of this team.
commentString that will be assigned to the proponent_comment, reviwer_comment, or acknowledger comment.
statusTeamMembershipStatus value must be either Approved, Proposed or Admin. If the new member is a team, the status will be changed to Invited unless the user is also an admin of that team.
force_team_addIf the person is actually a team and force_team_add is False, the team will actually be invited to join this one. Otherwise the team is added as if it were a person.
may_subscribe_to_listIf the person is not a team, and may_subscribe_to_list is True, then the person may be subscribed to the team's mailing list, depending on the list status and the person's auto-subscribe settings.
ReturnsA tuple containing a boolean indicating when the membership status changed and the current TeamMembershipStatus. This depends on the desired status passed as an argument, the membership policy and the user's privileges.
@operation_parameters(copy_field(ITeamMembership['team']), Text())
@export_write_operation()
@operation_for_version('beta')
def acceptInvitationToBeMemberOf(team, comment):
Accept an invitation to become a member of the given team.

There must be a TeamMembership for this person and the given team with the INVITED status. The status of this TeamMembership will be changed to APPROVED.

@operation_parameters(copy_field(ITeamMembership['team']), Text())
@export_write_operation()
@operation_for_version('beta')
def declineInvitationToBeMemberOf(team, comment):
Decline an invitation to become a member of the given team.

There must be a TeamMembership for this person and the given team with the INVITED status. The status of this TeamMembership will be changed to INVITATION_DECLINED.

@call_with(REQUEST_USER)
@operation_parameters(copy_field(ITeamMembership['team']), Text(False))
@export_write_operation()
@operation_for_version('beta')
def retractTeamMembership(team, user, comment=None):
Retract this team's membership in the given team.

If there's a membership entry for this team on the given team and its status is either APPROVED, ADMIN, PENDING, or INVITED, the status is changed and the relevant entries in TeamParticipation.

APPROVED and ADMIN status are changed to DEACTIVATED. PENDING status is changed to DECLINED. INVITED status is changes to INVITATION_DECLINED.

ParametersteamThe team to leave.
userThe user making the retraction.
commentAn optional explanation about why the change was made.
def renewTeamMembership(team):
Renew the TeamMembership for this person on the given team.

The given team's renewal policy must be ONDEMAND and the membership must be active (APPROVED or ADMIN) and set to expire in less than DAYS_BEFORE_EXPIRATION_WARNING_IS_SENT days.

def security_field_changed(subject, change_description, recipient_emails=None):
Trigger email when a secured field like preferredemail changes.
Parametersrecipient_emailsIf supplied custom email addresses to notify. This is used when a new preferred email address is set.
subjectThe subject to use.
change_descriptionA textual description to use when notifying about the change.
@operation_parameters(Reference(Interface, False), TextLine(True, name_validator), TextLine(False), TextLine(False), Bool(False), Bool(False))
@export_factory_operation(Interface, )
@operation_for_version('beta')
def createPPA(distribution=None, name=None, displayname=None, description=None, private=False, suppress_subscription_notifications=False):
Create a PPA.
ParametersdistributionThe distribution that this archive is for.
nameThe name of the new PPA to create.
displaynameThe displayname for the new PPA.
descriptionThe description for the new PPA.
privateWhether or not to create a private PPA. Defaults to False, which means the PPA will be public.
suppress_subscription_notificationsWhether or not to suppress emails to new subscribers about their subscriptions. Only meaningful for private PPAs.
Returnsa PPA IArchive record.
RaisesPPACreationError if an error is encountered
API Documentation for Launchpad, generated by pydoctor at 2019-04-24 00:00:10.