I have a few new custom objects in my unmanaged package and i want to give permissions to existing profiles in the target org. How can i do that? What i tried is the following xml file in my package:
<?xml version="1.0" encoding="UTF-8"?>
<Profile xmlns="http://soap.sforce.com/2006/04/metadata">
<objectPermissions>
<allowEdit>true</allowEdit>
<object>Object1__c</object>
</objectPermissions>
<objectPermissions>
<allowEdit>true</allowEdit>
<object>Object2__c</object>
</objectPermissions>
<objectPermissions>
<allowEdit>true</allowEdit>
<object>Object3__c</object>
</objectPermissions>
</Profile>
There is a profile in the target system called System Administrator
so i named the file SystemAdministrator.profile.xml-meta.xml
.
Im getting this error when installing the package:
Encountered errors installing the package!,Installation errors:
1) Error parsing file: Element {http://soap.sforce.com/2006/04/metadata}objectPermissions invalid at this location in type EmailServicesFunction, Details: SystemAdministrator.profile: Error parsing file: Element {http://soap.sforce.com/2006/04/metadata}objectPermissions invalid at this location in type EmailServicesFunction
Now im not sure if i did everything correct and its a different problem, or the file above is not working.
[select id, name, fullName from Profile where name = 'System Administrator']
) and it should be .profile-meta.xml