l.r.i.w.ISharingService(IService) : interface documentation

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

No interface docstring
Method checkPillarAccess Check the person's access to the given pillars and information type.
Method getAccessPolicyGrantCounts Return the number of grantees who have policy grants of each type.
Method getSharedProjects Find projects for which person has one or more access policy grants.
Method getSharedDistributions Find distributions for which person has one or more access policy
Method getSharedArtifacts Return the artifacts shared between the pillar and person.
Method getSharedBugs Return the bugs shared between the pillar and person.
Method getSharedBranches Return the branches shared between the pillar and person.
Method getSharedGitRepositories Return the Git repositories shared between the pillar and person.
Method getSharedSpecifications Return the specifications shared between the pillar and person.
Method getVisibleArtifacts Return the artifacts shared with person.
Method getInvisibleArtifacts Return the artifacts which are not shared with person.
Method getPeopleWithoutAccess Return the people who cannot access an artifact.
Method getAllowedInformationTypes Return the allowed private information types for the given pillar.
Method getBugSharingPolicies Return the allowed bug sharing policies for the given pillar.
Method getBranchSharingPolicies Return the allowed branch sharing policies for the given pillar.
Method getSpecificationSharingPolicies Return specification sharing policies for a given pillar.
Method getSharingPermissions Return the information sharing permissions.
Method getPillarGrantees Return people/teams who can see pillar artifacts.
Method getPillarGranteeData Return people/teams who can see pillar artifacts.
Method jsonGranteeData Return people/teams who can see pillar artifacts.
Method sharePillarInformation Ensure grantee has the grants for information types on a pillar.
Method deletePillarGrantee Remove a grantee from a pillar.
Method revokeAccessGrants Remove a grantee's access to the specified artifacts.
Method ensureAccessGrants Ensure a grantee has an access grant to the specified artifacts.
Method updatePillarSharingPolicies Update the sharing policies for a pillar.
def checkPillarAccess(pillars, information_type, person):
Check the person's access to the given pillars and information type.
ReturnsTrue if the user has been granted SharingPermission.ALL on any of the specified pillars.
def getAccessPolicyGrantCounts(pillar):
Return the number of grantees who have policy grants of each type.

Returns a resultset of (InformationType, count) tuples, where count is the number of grantees who have an access policy grant for the information type.

@export_read_operation()
@call_with(REQUEST_USER)
@operation_parameters(Reference(IPerson, _('Person'), True))
@operation_returns_collection_of(IProduct)
@operation_for_version('devel')
def getSharedProjects(person, user):
Find projects for which person has one or more access policy grants.
Parametersuserthe user making the request. If the user is an admin, then all projects are returned, else only those for which the user is a maintainer or driver.
Returnsa collection of projects
@export_read_operation()
@call_with(REQUEST_USER)
@operation_parameters(Reference(IPerson, _('Person'), True))
@operation_returns_collection_of(IDistribution)
@operation_for_version('devel')
def getSharedDistributions(person, user):
Find distributions for which person has one or more access policy
grants.
Parametersuserthe user making the request. If the user is an admin, then all distributions are returned, else only those for which the user is a maintainer or driver.
Returnsa collection of distributions
def getSharedArtifacts(pillar, person, user):
Return the artifacts shared between the pillar and person.

The result includes bugtasks rather than bugs since this is what the pillar filtering is applied to and is what the calling code uses. The shared bug can be obtained simply by reading the bugtask.bug attribute.

Parametersuserthe user making the request. Only artifacts visible to the user will be included in the result.
Returnsa (bugtasks, branches, gitrepositories, specifications) tuple
@export_read_operation()
@call_with(REQUEST_USER)
@operation_parameters(Reference(IPillar, _('Pillar'), True), Reference(IPerson, _('Person'), True))
@operation_returns_collection_of(IBug)
@operation_for_version('devel')
def getSharedBugs(pillar, person, user):
Return the bugs shared between the pillar and person.

The result includes bugtasks rather than bugs since this is what the pillar filtering is applied to. The shared bug can be obtained simply by reading the bugtask.bug attribute.

Parametersuserthe user making the request. Only bugs visible to the user will be included in the result.
Returnsa collection of bug tasks.
@export_read_operation()
@call_with(REQUEST_USER)
@operation_parameters(Reference(IPillar, _('Pillar'), True), Reference(IPerson, _('Person'), True))
@operation_returns_collection_of(IBranch)
@operation_for_version('devel')
def getSharedBranches(pillar, person, user):
Return the branches shared between the pillar and person.
Parametersuserthe user making the request. Only branches visible to the user will be included in the result.
Returnsa collection of branches
@export_read_operation()
@call_with(REQUEST_USER)
@operation_parameters(Reference(IPillar, _('Pillar'), True), Reference(IPerson, _('Person'), True))
@operation_returns_collection_of(IGitRepository)
@operation_for_version('devel')
def getSharedGitRepositories(pillar, person, user):
Return the Git repositories shared between the pillar and person.
Parametersuserthe user making the request. Only Git repositories visible to the user will be included in the result.
Returnsa collection of Git repositories.
@export_read_operation()
@call_with(REQUEST_USER)
@operation_parameters(Reference(IPillar, _('Pillar'), True), Reference(IPerson, _('Person'), True))
@operation_returns_collection_of(ISpecification)
@operation_for_version('devel')
def getSharedSpecifications(pillar, person, user):
Return the specifications shared between the pillar and person.
Parametersuserthe user making the request. Only branches visible to the user will be included in the result.
Returnsa collection of specifications.
def getVisibleArtifacts(person, bugs=None, branches=None, gitrepositories=None, specifications=None):
Return the artifacts shared with person.

Given lists of artifacts, return those a person has access to either via a policy grant or artifact grant.

Parameterspersonthe person whose access is being checked.
bugsthe bugs to check for which a person has access.
branchesthe branches to check for which a person has access.
gitrepositoriesthe Git repositories to check for which a person has access.
specificationsthe specifications to check for which a person has access.
Returnsa collection of artifacts the person can see.
def getInvisibleArtifacts(person, bugs=None, branches=None, gitrepositories=None):
Return the artifacts which are not shared with person.

Given lists of artifacts, return those a person does not have access to
either via a policy grant or artifact grant.
* Do not export this method to the API since it could be used to gain
  access to private information. Internal use only. *

:param person: the person whose access is being checked.
:param bugs: the bugs to check for which a person has access.
:param branches: the branches to check for which a person has access.
:param gitrepositories: the Git repositories to check for which a
    person has access.
:return: a collection of artifacts the person can not see.
def getPeopleWithoutAccess(concrete_artifact, people):
Return the people who cannot access an artifact.

Given a list of people, return those who do not have access to the specified bug or branch.

Parametersconcrete_artifactthe bug or branch whose access is being checked.
peoplethe people whose access is being checked.
Returnsa collection of people without access to the artifact.
def getAllowedInformationTypes(pillar):
Return the allowed private information types for the given pillar.

The allowed information types are those for which bugs and branches may be created. This does not mean that there will necessarily be bugs and branches of these types; the result is used to populate the allowed choices in the grantee sharing pillar and other similar things.

The allowed information types are determined by the pillar's bug and branch sharing policies. It is possible that there are bugs or branches of a given information type which is now nominally not allowed with a change in policy. Such information types are also included in the result.

def getBugSharingPolicies(pillar):
Return the allowed bug sharing policies for the given pillar.
def getBranchSharingPolicies(pillar):
Return the allowed branch sharing policies for the given pillar.
def getSpecificationSharingPolicies(pillar):
Return specification sharing policies for a given pillar.
def getSharingPermissions():
Return the information sharing permissions.
def getPillarGrantees(pillar):
Return people/teams who can see pillar artifacts.
@export_read_operation()
@operation_parameters(Reference(IPillar, _('Pillar'), True))
@operation_for_version('devel')
def getPillarGranteeData(pillar):

Return people/teams who can see pillar artifacts.

The result records are json data which includes:
  • person name
  • permissions they have for each information type.
def jsonGranteeData(grant_permissions):

Return people/teams who can see pillar artifacts.

The result records are json data which includes:
  • person name
  • permissions they have for each information type.
Parametersgrant_permissionsa list of (grantee, accesspolicy, permission) tuples.
@export_write_operation()
@call_with(REQUEST_USER)
@operation_parameters(Reference(IPillar, _('Pillar'), True), Reference(IPerson, _('Grantee'), True), Dict(Choice(InformationType), Choice(SharingPermission)))
@operation_for_version('devel')
def sharePillarInformation(pillar, grantee, user, permissions):
Ensure grantee has the grants for information types on a pillar.
Parameterspillarthe pillar for which to grant access
granteethe person or team to grant
userthe user making the request
permissionsa dict of {InformationType: SharingPermission} if SharingPermission is ALL, then create an access policy grant if SharingPermission is SOME, then remove any access policy grants if SharingPermission is NONE, then remove all grants for the access policy
@export_write_operation()
@call_with(REQUEST_USER)
@operation_parameters(Reference(IPillar, _('Pillar'), True), Reference(IPerson, _('Grantee'), True), List(Choice(InformationType), False))
@operation_for_version('devel')
def deletePillarGrantee(pillar, grantee, user, information_types):
Remove a grantee from a pillar.
Parameterspillarthe pillar from which to remove access
granteethe person or team to remove
userthe user making the request
information_typesif None, remove all access, otherwise just remove the specified access_policies
@export_write_operation()
@call_with(REQUEST_USER)
@rename_parameters_as('git_repositories')
@operation_parameters(Reference(IPillar, _('Pillar'), True), Reference(IPerson, _('Grantee'), True), List(Reference(IBug), _('Bugs'), False), List(Reference(IBranch), _('Branches'), False), List(Reference(IGitRepository), _('Git repositories'), False), List(Reference(ISpecification), _('Specifications'), False))
@operation_for_version('devel')
def revokeAccessGrants(pillar, grantee, user, bugs=None, branches=None, gitrepositories=None, specifications=None):
Remove a grantee's access to the specified artifacts.
Parameterspillarthe pillar from which to remove access
granteethe person or team for whom to revoke access
userthe user making the request
bugsthe bugs for which to revoke access
branchesthe branches for which to revoke access
gitrepositoriesthe Git repositories for which to revoke access
specificationsthe specifications for which to revoke access
@export_write_operation()
@call_with(REQUEST_USER)
@rename_parameters_as('git_repositories')
@operation_parameters(List(Reference(IPerson, _('Grantee'), True)), List(Reference(IBug), _('Bugs'), False), List(Reference(IBranch), _('Branches'), False), List(Reference(IGitRepository), _('Git repositories'), False))
@operation_for_version('devel')
def ensureAccessGrants(grantees, user, bugs=None, branches=None, gitrepositories=None, specifications=None):
Ensure a grantee has an access grant to the specified artifacts.
Parametersgranteesthe people or teams for whom to grant access
userthe user making the request
bugsthe bugs for which to grant access
branchesthe branches for which to grant access
gitrepositoriesthe Git repositories for which to grant access
specificationsthe specifications for which to grant access
@export_write_operation()
@operation_parameters(Reference(IPillar, _('Pillar'), True), Choice(BranchSharingPolicy), Choice(BugSharingPolicy), Choice(SpecificationSharingPolicy))
@operation_for_version('devel')
def updatePillarSharingPolicies(pillar, branch_sharing_policy=None, bug_sharing_policy=None, specification_sharing_policy=None):
Update the sharing policies for a pillar.
Parameterspillarthe pillar to update
branch_sharing_policythe new branch sharing policy
bug_sharing_policythe new bug sharing policy
specification_sharing_policynew specification sharing policy
API Documentation for Launchpad, generated by pydoctor at 2019-11-14 00:00:13.