You need to sign in to do that
Don't have an account?
lei.zhang@zuora.com
Where I can find the description of Profile methods
There is a standard Object in salesforce: Profile. It has some permission methods, where I can find the description of the methods.
eg.
String profileId = UserInfo.getProfileId();
Profile curProfile = [select Id, Name from Profile Where Id =: profileId limit 1];
curProfile.PermissionsEditReadonlyFields("maybe have parameters");
curProfile.PermissionsManageCategories("maybe have parameters");
curProfile........
I want to find the description of PermissionsEditReadonlyFields, PermissionsManageCategories and so on.
Thanks.
----
Lei
I think there's some confusion here between the profile object available from apex and the profile object available from the web services api.
The Permission<PermissionName> methods are available when accessing a profile via the web services api. When retrieving a profile via SOQL, you are dealing with a standard sobject and thus these methods won't be available. The only permission information that you will be able to access are fields that have been retrieved via the query.
All Answers
I think there's some confusion here between the profile object available from apex and the profile object available from the web services api.
The Permission<PermissionName> methods are available when accessing a profile via the web services api. When retrieving a profile via SOQL, you are dealing with a standard sobject and thus these methods won't be available. The only permission information that you will be able to access are fields that have been retrieved via the query.
Thank you for you reply.
I find PermissionsEditReadonlyFields, PermissionsManageCategories and so on are fields of Profile, not methods.
Bellow works well:
public class ATest {
public static Boolean myTest() {
String profileId = UserInfo.getProfileId();
Profile curProfile = [select Id, Name, PermissionsEditReadonlyFields from Profile Where Id =: profileId limit 1];
return curProfile.PermissionsEditReadonlyFields;
}
}
Thanks.
----
Lei