Closed swapnilgaonkar closed 4 years ago
Hi @swapnilgaonkar,
You can try getting all roles and check which exist. For none existing role definitions it's expected to receive an error from the API.
rd, err := web.RoleDefinitions().Get()
if err != nil {
t.Error(err)
}
for _, r := range rd {
fmt.Println(r.Name)
}
Thanks for the reply and sorry for the delayed response. It was issue from my side. Above functionality working as expected. Thanks
Thanks for coming back with the update. Closing the issue.
Function sp.Web().RoleDefinitions().GetByName() is working fine for (edit, read, Design) but it is not working for (Manage Hierarchy, Restricted Read, Restricted Interfaces for Translation). It fails with error 'value does not fall within the expected range'
Can you provide any help