l.c.i.b.IBranchNamespacePolicy(Interface) : interface documentation

Part of lp.code.interfaces.branchnamespace View In Hierarchy

Methods relating to branch creation and validation.
Method canCreateBranches Is the user allowed to create branches for this namespace?
Method getAllowedInformationTypes Get the information types that a branch in this namespace can have.
Method getDefaultInformationType Get the default information type for branches in this namespace.
Method validateRegistrant Check that the registrant can create a branch on this namespace.
Method validateBranchName Check the branch name.
Method validateMove Check that 'mover' can move 'branch' into this namespace.
def canCreateBranches(user):
Is the user allowed to create branches for this namespace?
ParametersuserAn IPerson.
ReturnsA Boolean value.
def getAllowedInformationTypes(who):
Get the information types that a branch in this namespace can have.

:param who: The user making the request.
:return: A sequence of `InformationType`s.
def getDefaultInformationType(who):
Get the default information type for branches in this namespace.
ParameterswhoThe user for whom to return the information type.
ReturnsAn InformationType.
def validateRegistrant(registrant, branch=None):
Check that the registrant can create a branch on this namespace.
ParametersregistrantAn IPerson.
branchAn optional IBranch to also check when working with imported branches.
RaisesBranchCreatorNotMemberOfOwnerTeamif the namespace owner is a team, and the registrant is not in that team.
BranchCreatorNotOwnerif the namespace owner is an individual and the registrant is not the owner.
BranchCreationForbiddenif the registrant is not allowed to create a branch in this namespace due to privacy rules.
def validateBranchName(name):
Check the branch name.
ParametersnameA branch name, either string or unicode.
RaisesBranchExistsif a branch with the name exists already in the namespace.
LaunchpadValidationErrorif the name doesn't match the validation constraints on IBranch.name.
def validateMove(branch, mover, name=None):
Check that 'mover' can move 'branch' into this namespace.
ParametersbranchAn IBranch that might be moved.
moverThe IPerson who would move it.
nameA new name for the branch. If None, the branch name is used.
RaisesBranchCreatorNotMemberOfOwnerTeamif the namespace owner is a team, and 'mover' is not in that team.
BranchCreatorNotOwnerif the namespace owner is an individual and 'mover' is not the owner.
BranchCreationForbiddenif 'mover' is not allowed to create a branch in this namespace due to privacy rules.
BranchExistsif a branch with the 'name' exists already in the namespace.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.