adding test for listing permission of project space by a user who is not a member of the space (#8927)

This commit is contained in:
nirajacharya2
2024-04-24 18:07:31 +05:45
committed by GitHub
parent 78ba483784
commit 30cb3729d4
2 changed files with 68 additions and 0 deletions
@@ -152,6 +152,32 @@ class SharingNgContext implements Context {
);
}
/**
* @When /^user "([^"]*)" tries to list the permissions of space "([^"]*)" owned by "([^"]*)" using permissions endpoint of the Graph API$/
*
* @param string $user
* @param string $space
* @param string $spaceOwner
*
* @return void
* @throws Exception
*/
public function userTriesToListThePermissionsOfSpaceUsingPermissionsEndpointOfTheGraphApi(string $user, string $space, string $spaceOwner):void {
$spaceId = ($this->spacesContext->getSpaceByName($spaceOwner, $space))["id"];
$itemId = $this->spacesContext->getResourceId($spaceOwner, $space, '');
$this->featureContext->setResponse(
GraphHelper::getPermissionsList(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$user,
$this->featureContext->getPasswordForUser($user),
$spaceId,
$itemId
)
);
}
/**
* @param string $user
* @param TableNode $table