Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions UserAccessVisualization/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/Referenced Packages/
/.settings/
6 changes: 6 additions & 0 deletions UserAccessVisualization/.project
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.salesforce.ide.builder.online</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.salesforce.ide.nature.default</nature>
<nature>com.salesforce.ide.nature.online</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ public class UserAccessDetailsController {
public List<NameLabel> getObjectLabels() {
if (null == xObjectLabels) {
List<NameLabel> result = new List<NameLabel>();
Map<String,SObjectType> describe = Schema.getGlobalDescribe();

// We can't really depend on describe to give us the object we want
// since that includes a lot of stuff that doesn't support CRUD
Expand All @@ -286,8 +285,14 @@ public class UserAccessDetailsController {
// for now.
for (ObjectPermissions op : [SELECT SObjectType FROM ObjectPermissions
WHERE Parent.Profile.Name = 'System Administrator']) {
result.add(new NameLabel(op.SObjectType,
describe.get(op.SObjectType).getDescribe().getLabel()));
// Try to get the label, but use the API name if we do not have a describe for the
// object. This may occur because this class's version is too low and does not support
// the new object.
Type sObjectType = Type.forName('Schema.'+op.SObjectType);
result.add(
new NameLabel(op.SObjectType,
sObjectType==null?op.SObjectType:((SObject)sObjectType.newInstance()).getSObjectType().getDescribe().getLabel())
);
}
result.sort();
xObjectLabels = result;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>28.0</apiVersion>
<apiVersion>35.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion UserAccessVisualization/src/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
<members>*</members>
<name>StaticResource</name>
</types>
<version>25.0</version>
<version>33.0</version>
</Package>