Recently after upgrade of our Dynamics 365 CE from 8.2 to 9.1, when the System Administrator tried importing the solution (managed), he got the below errorYou do not have the necessary privileges to import security roles. : Microsoft.Crm.CrmSecurityException: SecLib::CheckPrivilege failed. User: e7282250-7d82-e711-80df-1458d0431690, PrivilegeName: prvWriteRole, PrivilegeId: bd123e14-17ba-40f6-8d8b-18f4bffa7e50, Required
The error message is quite weird, first as we have never got this error earlier and here it was System Administrator user who was importing.
We tried importing the solution with the using another System Adminstrator account and it worked for that other user.
Hope it helps..