As you say,
HasUniqueRoleAssignments is just a flag that tells you whether or not the item has unique permissions.
In order to get the actual permission information, you would need to also expand the
RoleAssignments property itself:
You still might have to add additional params to the
$expand in order to get information you find useful, from my quick test in Postman, expanding
RoleAssignments results in a couple properties that have
__deferred URIs, and the single
PrincipalId property that actually has data, which I guess could be useful if you already know the user IDs of relevant users, or else you would have to make an additional query to get more detailed user information.
To address your additional question from the comments:
i want to understand if the file is inheriting permission from its
parent folder/list. Do we have any such property in RoleAssignments
thats will help?
There is a property that will tell you that information, but it's not within
RoleAssignments. You're already getting that property - it's the
HasUniqueRoleAssignments property itself that will tell you.
true, then it is not inheriting permissions, it has unique permissions.
false, then it does not have unique permissions, and therefore is inheriting permissions from a parent object, whether that be a folder, or the document library it is in, or the parent web site where the document library is.
false you can check the
FirstUniqueAncestorSecurableObject property to find out exactly which object the file is inheriting its permissions from.