Hello Jonah Jordan,
Thanks for reaching out!
Custom security attributes can be assigned to the following objects by using the customSecurityAttributes
property. Directory synced users from an on-premises Active Directory can also be assigned custom security attributes.
To assign, update, or remove custom security attribute assignments, the calling principal must be assigned the following Azure AD role. By default, Global Administrator and other administrator roles do not have permissions to read, define, or assign custom security attributes.
Also, the calling principal must be granted the following permissions.
Permissions to read, assign, update, or remove custom security attribute assignments for an application is granted by CustomSecAttributeAssignment.ReadWrite.All. Permissions to read the resource object, such as users, is granted separately using resource object permissions, such as User.Read.All.
To list or read custom security attribute assignments, the calling principal must be assigned one of the following Azure AD roles. By default, Global Administrator and other administrator roles do not have permissions to read, define, or assign custom security attributes.
Also, the calling principal must be granted the following permissions.
Permissions to read custom security attribute assignments for an application is granted by CustomSecAttributeAssignment.Read.All. Permissions to read the resource object, such as users, is granted separately using resource object permissions, such as User.Read.All.
Note: The custom security attributes feature is currently in preview.
If there are no custom security attributes assigned to the user or if the calling principal does not have access, the following will be the response:
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#users(customSecurityAttributes)/$entity",
"customSecurityAttributes": null
}
References:
- What are custom security attributes?
- Custom Security Attributes - Graph API
- Assign, update, list, or remove custom security attribute assignments using the Microsoft Graph API (preview)
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.
Hi @CarlZhao-MSFT ,
i’m using the /me endpoint so it’s pointing to the currently logged in user.
Hi @Jonah Jordan
You say that when you use a specific user id it returns correctly. How do you use a specific user id, is calling the
/users/{user id}
endpoint?@CarlZhao-MSFT, I believe the issue is that
https://graph.microsoft.com/beta/me?$select=customSecurityAttributes -> Does not return the property
https://graph.microsoft.com/beta/users/{user-id}?$select=customSecurityAttributes -> Returns the property.
Shouldn't the two endpoints return the same results?
Sign in to comment