[full-ci] [tests-only] unassign app role assignment of user (#6030)

* Added scenario to unassign the role of user

* Added scenario,admin tries to unassign the own role

* Addressed reviews

* refactor

---------

Co-authored-by: Saw-jan <saw.jan.grg3e@gmail.com>
This commit is contained in:
Prarup Gurung
2023-05-15 10:45:24 +02:00
committed by GitHub
co-authored by Saw-jan
parent d6b4632e1c
commit 4b04870ade
4 changed files with 184 additions and 0 deletions
+30
View File
@@ -1394,4 +1394,34 @@ class GraphHelper {
\json_encode($payload)
);
}
/**
* @param string $baseUrl
* @param string $xRequestId
* @param string $user
* @param string $password
* @param string $appRoleAssignmentId
* @param string $userId
*
* @return ResponseInterface
* @throws GuzzleException
*/
public static function unassignRole(
string $baseUrl,
string $xRequestId,
string $user,
string $password,
string $appRoleAssignmentId,
string $userId
): ResponseInterface {
$url = self::getFullUrl($baseUrl, 'users/' . $userId . '/appRoleAssignments/' . $appRoleAssignmentId);
return HttpRequestHelper::sendRequest(
$url,
$xRequestId,
"DELETE",
$user,
$password,
self::getRequestHeaders(),
);
}
}