License and Permission Assignments

Note

Within the Salesforce universe, the term “Skuid license” refers to a user’s ability to interact with Skuid. While the Skuid UI reflects this terminology to avoid confusion, the “number of Skuid licenses” you have refers to purchased Skuid subscriptions.

Any end user who will be viewing Skuid needs to be assigned a Skuid license and the Skuid Page Viewer permission set. Any user who will be editing Skuid Pages needs to be assigned the Skuid Page Builder Permission set.

Warning

When using Skuid as a Salesforce managed package (Skuid SFX), all licensed Skuid users must also have a valid Salesforce license.

Like any other Salesforce Custom Objects, you can configure security, sharing and permissions for the Skuid Page and Page Assignment objects. We recommend you configure the sharing setting for these objects to public read only.

  • The Skuid Page Viewer permission set lets end users read Pages and Page Assignments.
  • The Skuid Page Builder permission set lets end users read, create, edit and delete Pages, Page Assignments, Page Revisions, and other objects in the Skuid package.
  • The Skuid Admin permission set gives users the same options as the Skuid Page Builder permission set, and also allows access the XML Editor on Skuid pages.
  • Out of the box, none of these permission sets have View All and Modify All permissions on these objects.

Warning

It’s important to utilize a sandbox environment to test all aspects of your Skuid configuration, and this includes license assignments. By default, Salesforce assigns a site license in sandbox orgs—meaning assigning individual licenses is not possible.

To accurately test how automatically assigning licenses could affect your configuration, please contact salesops@skuid.com to limit your sandbox licenses to a specific number of users—allowing you to assign and test properly.

The Licensing / Permissions screen

To access Skuid’s license and permission set tools, navigate to Settings > Licensing / Permissions. This screen is made up of several sections, the most important of which allow for auto-assigning and auto-revoking of licenses and permission sets.

There are two primary ways of setting assign/revocation rules for licenses and permission sets in Skuid:

  • Whenever a user in your org is created / activated / deactivated (Configured in the Org Defaults section)
  • Whenever a a user with a specific profile is created/ activated / deactivated in your org (Configured as multiple rules in the Profile-specific settings section)

Note

Changes made to a Salesforce user other than creating / activating / deactivating will not be reflected in that user’s licensing or permissions settings in Skuid.

User Licensing / Permissions

This area contains links to Salesforce setup pages that allow you to manually assign Skuid licenses and permission sets.

By visiting these links (or navigating the Salesforce setup UI), you may assign Skuid’s necessary permission sets to single users or to multiple users as noted in Salesforce documentation.

Org Defaults

This area contains tool to manage auto-assigning or auto-revoking licenses and permission sets from all new users or all deactivated users.

Package licenses

To auto-assign licenses to any user when they are created / activated:

  1. Enable Auto Assign Licenses on Activation.

  2. Click the Packages to Auto-Assign Licenses to setting to pick one or more package licenses to assign.

    This means you can auto-assign licenses to Skuid and any other packages listed in the dropdown menu.

To auto-revoke licenses of deactivated users:

  1. Enable Auto Revoke Licenses on Deactivation.

  2. Click the Packages to Auto-Revoke Licenses to setting to pick one or more package licenses to revoke.

    This means you can auto-revoke licenses to Skuid and any other packages listed in the dropdown menu.

Permission sets

To auto-assign permission sets to any user when they are created / activated:

  1. Enable Auto Assign Perm Sets on Activation.

  2. Click the Permission Sets to Auto-Assign setting to pick one or more permission sets to assign.

    This means you can auto-assign Skuid’s own necessary permission sets and any other permission sets listed in the dropdown menu.

To auto-revoke permission sets of deactivated users:

  1. Enable Auto Revoke Perm Sets on Deactivation.

  2. Click the Permission Sets to Auto-Revoke setting to pick one or more permission sets to assign.

    This means you can auto-revoke Skuid’s own necessary permission sets and any other permission sets listed in the dropdown menu.

Profile-specific Settings

If you want to specify which licenses and permission sets are auto-assigned/revoked to specific profiles, you can do so by adding profile-specific rules in this section.

Once you set up a profile-specific rule, the selected licenses/permission sets are auto-assigned/revoked when any user with that profile is created/ activated / deactivated in your org.

Note

It is possible to use profile-specific settings instead of or in addition to org defaults.

To add a profile-specific rule:

  1. Click Add within the Profile-specific settings section.

  2. Start typing the name of one of your Salesforce profiles and select it from the list.

  3. Check the boxes of the things you want to be auto-assigned/revoked.

    The options available in the modal mirror those described in the Org Defaults section.

  4. Click Add to save the rule.

Other Assignment Methods

Mass assign licenses using Data Loader

It’s also possible to mass assign licenses to a number of end users through Salesforce’s Data Loader tool. This can be especially useful for an initial rollout, where auto-assgining licenses may not help since users are already activated.

For more information, see Salesforce’s knowledge article.

Anonymous Apex script: Mass Assign the Skuid Page Viewer Permission Set

Warning

The scripts below are only examples of how this can be done. We recommend having an admin fluent in Apex modify this script for your org’s needs. And as such, the insert assn statement must be uncommented for the scripts to take effect.

Using this script without understanding its impact could have unintended consequences. Use at your own risk.

Assign a Skuid permission set to all active SFDC/AUL licenses

This anonymous Apex script can be run by an admin to help mass assign the Skuid Page Viewer Permission Set to all active Salesforce licensed-users who do not already have the permission set. Be sure that this is what you want to do before using this script.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
////////////////////////////////////////////////////////////////
// Assign a Skuid Permission Set to all active SFDC/AUL licenses
////////////////////////////////////////////////////////////////
PermissionSet ps = [SELECT Id, Name FROM PermissionSet WHERE Name = 'Skuid_Page_Viewer' limit 1];
List<PermissionSetAssignment> assn = new List<PermissionSetAssignment>();
List<User> users = [
  SELECT Id
  FROM User
  WHERE Id NOT IN (SELECT AssigneeId FROM PermissionSetAssignment WHERE PermissionSetId = :ps.Id)
  AND Profile.UserLicense.LicenseDefinitionKey IN ('AUL', 'SFDC')
  AND IsActive = true
  LIMIT 10000
];
for (User u : users) {
  assn.add(new PermissionSetAssignment(
    AssigneeId = u.Id,
    PermissionSetId = ps.Id
  ));
}
//system.assert(false,assn.size());
try {
//  insert assn;
    system.debug('Permission Sets Assigned => ' + assn.size());
} catch (Exception ex) {
  system.assert(false, ex.getMessage());
}

Assign a Skuid permission set to all active Skuid licensees

The following code assigns permission sets to all users assigned a Skuid license who do not already have the permission set. Remember, test and adjust the code to meet your needs.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//////////////////////////////////////////////////////////////
// Assign a Skuid Permission Set to all active Skuid licensees
//////////////////////////////////////////////////////////////
PermissionSet ps = [SELECT Id, Name FROM PermissionSet WHERE Name = 'Skuid_Page_Viewer' limit 1];
List<PermissionSetAssignment> assn = new List<PermissionSetAssignment>();
String APP_NAMESPACE_PREFIX = 'skuid';
List<User> users = [
    SELECT Id
    FROM User
    WHERE Id NOT IN (SELECT AssigneeId FROM PermissionSetAssignment WHERE PermissionSetId = :ps.Id)
    AND Id IN (
            SELECT UserId
            FROM UserPackageLicense
            WHERE PackageLicense.NamespacePrefix = :APP_NAMESPACE_PREFIX
        )
    AND IsActive = true
    LIMIT 10000
];
for (User u : users) {
    assn.add(new PermissionSetAssignment(
            AssigneeId = u.Id,
            PermissionSetId = ps.Id
    ));
}
//system.assert(false,assn.size());
try {
//  insert assn;
    system.debug('Permission Sets Assigned => ' + assn.size());
} catch (Exception ex) {
    system.assert(false, ex.getMessage());
}

Other Considerations

Skuid Sample Page: License Management

If you commonly need to see an overview of active Skuid licenses within your org, consider implementing this License Management sample page in your Salesforce org.

Non-Skuid users will still access standard layouts

If you use the tutorials for overriding tabs in Salesforce, (either using page assignments or direct visual force page overrides) users without Skuid licenses or privileges will still be able to access the standard salesforce layouts.

User with a Skuid Subscription

When you override standard Salesforce pages with your own Skuidified one, a user who has a Skuid subscription will see a Skuid page:

User without a Skuid Subscription

Users that do not have Skuid subscriptions will see the standard Salesforce Layout

In Salesforce Setup, make Pages and Page Assignments Public Read Only

|image2|

Change the Default Access for Page and Page Assignment to “Public Read Only” and then click Save.

|image3|

We recommend that you set the Default Access for the Page, and Page Assignment objects to Public Read Only.

Troubleshooting

If you are making user-level changes in Saleforce, yet the license and permission sets stipulated in your Organization-wide Defaults or Profile-specific Settings are not correctly being assigned or revoked from the user, note that Skuid’s Organization-wide Defaults and Profile-specific Settings are assigned upon the creation, activation, or deactivation of a user. No other types of user changes will trigger this automatic assignment/revocation of license and permission sets.

If you wish to make other types of changes to a user in Salesforce, and want to also change their Skuid licensing or permission sets:

  • In the User Detail page, deactivate the user.
  • Make the changes and Save.
  • Reactivate the user with the new settings.

If you need to manually remove or add Skuid licenses, you can do so by following the process outlined by Salesforce for assigning licenses for managed packages. You will also need to manually add and remove the Skuid permission sets for those individuals.

Potential error messages

  • SObject row was retrieved via SOQL without querying the requested field: skuid__Page__c.skuid__MasterPage__r  An unexpected error has occurred. Your solution provider has been notified.

    This often shows if a user does not have the Skuid Page Viewer permission set. If a builder sees this message, verify they have the Skuid Page Viewer permission set assigned to them.

  • It’s possible for a builder to see a variety of field relationship request errors in the Composer if the Skuid Page Builder is not assigned. If a builder sees error messages similar to the shortened examples below, verify they have the Skuid Page Builder permission set assigned to them.

    • A Skuid Model, 'page', requested a Field with relationship name ...
    • A Skuid Model, 'pageBuilder_SelectedVersion', requested a Field with relationship name ...
    • A Skuid Model, 'pgs__NewPage', requested a Field with relationship name ...
    • A Skuid Model, 'versions', requested a Field with relationship name ...
    • A Skuid Model, 'ClonePageData', requested a Field with relationship name ...

If you have other Apex triggers

Due to Salesforce restrictions regarding setup object operations, Skuid’s triggers may not function well in combination with other user-creation triggers. If Skuid’s triggers and your triggers are grouped as a single transaction, you may see unexpected behaviors or your licenses and permissions may not assign properly.

If you have existing user-creation triggers, or wish to implement additional triggers, consider one of the following alternatives:

  • If you “own the code” for the additional triggers, consider placing setup object DML statements within future methods to ensure that they run within a separate transaction.
  • If you do not wish to use future methods, consider writing your own auto-licensing and permission granting functionality into new or existing functions. This will give you greater control over how and when licenses are assigned and will reduce the likelihood of undesired results.

Customize Application and its effect on page caching

Skuid stores its “last modified” timestamps for v2 pages within custom settings. When pages are loaded for end users, this “last modified” timestamp is then used to determine whether or not the user’s cached page should be cleared and new page data should be retrieved.

While this helps speed up load times for end users, there can be unexpected issues if a Skuid builder does not have the Customize Application permission when they update a Skuid page. That’s because the Customize application is necessary in order to update custom setting values, including this last modified time stamp. If a builder updates a Skuid page without that permission, then the last modified timestamp is not updated correctly. That means the cache is not cleared properly, and any users with a cached version of that page will only see that cached version.

If pages appear to not be updating for some users, ensure those pages have been updated by a builder with the Customize Application permission. End users can also consider clearing their browser cache.

The steps to clear a browser’s cache and site data vary depending on the browser.

Visit the links below to learn the specific steps for a particular browser:

Licenses aren’t working in a sandbox org

Sandbox orgs are granted site licenses, meaning individual licenses are not assignable. You’ll need to contact Skuid to limit licenses in this scenario.