Closed stephenfuqua closed 3 months ago
The userclaims controller has three endpoints. Visit swagger for more information.
Returns a list of profiles that have been assigned a specified role. The page number and the role to match must be provided as query string parameters (e.g. 'userclaims?page=1&role=admin').
Response example:
{
"totalCount": 1,
"profiles": [
{
"id": "6494F430-48B7-4339-98B9-19D4E91342EC",
"staffUsi": 1,
"staffUniqueId": "0132398",
"firstName": "Patricia",
"middleName": null,
"lastSurname": "Ramirez",
"location": "Dallas",
"fullName": "PatriciaRamirez",
"isAdmin": true,
"username": "whatever"
}
],
"page": 1
}
Note 'isAdmin' indicates if the user profile is assigned the admin role
Provide an array of StaffUniqueId strings that will be assigned a claim based role provided in the request body.
{
"claimType": "role",
"claimValue": "Admin",
"staffUniqueIds": [
"0132398", "1000000017"
]
}
{
"resultMessage": "Processed 2 records",
"userResults": [
{
"userName": "whatever",
"succeeded": false,
"message": "Claim already added"
},
{
"userName": "anotheruser",
"succeeded": true,
"errors": []
}
]
}
Note when a claim already exists compared to the claim that was successfully assigned. The empty errors array indicates NO errors. Any error that does occur would appear here.
Removes a claim based role from the StaffUniqueId's provided
{
"claimType": "role",
"claimValue": "Admin",
"staffUniqueIds": [
"1000000017", "12345"
]
}
{
"resultMessage": "Processed 1 records",
"userResults": [
{
"userName": "anotheruser",
"succeeded": true,
"errors": []
}
]
}
Note that response contains a successful removal annotated in the succeeded parameter. The next response indicates no action was taken. While the user is a registered user, they do not have the claim assigned. Profiles that have not registered are not processed. Example:
{
"resultMessage": "Processed 1 records",
"userResults": [
{
"userName": "anotheruser",
"succeeded": false,
"message": "Claim not found to remove"
}
]
}
Created: 2021-02-24T21:47:03.493-0600 Commenter: Mark Harvey
Jira Description
1) List all Users (anyone who has registered for the leadership program with a tpdm username). 2) Allow Admin to elevate/promote a user to an "Admin" role. (role will be initially set based on the employment status of the user)
Jira Metadata
Key: LP-34 Epic: n/a Created: 2021-01-28T11:35:27.000-0600 Reporter: Yogiraj Aradhye