Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

DocGenPermsAndAccessChecksService Class

The DocGenPermsAndAccessChecksService class contains methods to check permissions and settings related to document generation and integration features.

Namespace

industries_docgen

Example

1industries_docgen.DocGenPermsAndAccessChecksService.isDesigner(UserInfo.getOrganizationId(), userInfo.getUserId(), 'DocGenDesigner');
2industries_docgen.DocGenPermsAndAccessChecksService.isRuntimeUser(UserInfo.getOrganizationId(), userInfo.getUserId(), 'DocGenRuntimeUser');
3industries_docgen.DocGenPermsAndAccessChecksService.isRuntimeCCUser(UserInfo.getOrganizationId(), userInfo.getUserId(),'DocGenRuntimeCCUser');

This Apex code sample checks whether a user has specific docgen permissions.

DocGenPermsAndAccessChecksService Methods

The following are methods for DocGenPermsAndAccessChecksService.

hasDocGenMetadataSetting(orgId, orgPreference)

Checks whether the DocGen metadata setting is enabled for the org (true) or not (false).

Signature

public static Boolean hasDocGenMetadataSetting(String orgId, String orgPreference)

Parameters

  • orgId: Type: String ID of the org.
  • orgPreference: Type: String Name of the DocGen metadata setting.

Return Value

Type: Boolean

hasDocGenOrgPerm(orgId, orgPermission)

Checks whether the org has the DocGen permission (true) or not (false).

Signature

public static Boolean hasDocGenOrgPerm(String orgId, String orgPermission)

Parameters

  • orgId: Type: String ID of the org.
  • orgPermission: Type: String Name of the permission.

Return Value

Type: Boolean

hasMS365IntegrationSettingOrgPerm(orgId, orgPermission)

Checks whether the org has a Microsoft 365 integration setting permission enabled (true) or not (false).

Signature

public static Boolean hasMS365InetgrationSettingOrgPerm(String orgId, String orgPermission)

Parameters

  • orgId: Type: String ID of the org.
  • orgPermission: Type: String Name of the permission.

Return Value

Type: Boolean

hasOmnistudioOrgPerm(orgId, orgPermission)

Checks whether the org has Omnistudio permission enabled (true) or not (false).

Signature

public static Boolean hasOmnistudioOrgPerm(String orgId, String orgPermission)

Parameters

  • orgId: Type: String ID of the org.
  • orgPermission: Type: String Name of the Omnistudio permission.

Return Value

Type: Boolean

isDesigner(orgId, userId, userPerm)

Checks whether the user has designer permissions enabled (true) or not (false).

Signature

public static Boolean isDesigner(String orgId, String userId, String userPerm)

Parameters

  • orgId: Type: String ID of the org.
  • userId: Type: String ID of the user.
  • userPerm: Type: String Name of the user permission to check for designer status.

Return Value

Type: Boolean

isRuntimeCCUser(orgId, userId, userPerm)

Checks whether the user has runtime customer community user permissions (true) or not (false).

Signature

public static Boolean isRuntimeCCUser(String orgId, String userId, String userPerm)

Parameters

  • orgId: Type: String ID of the org.
  • userId: Type: String ID of the user.
  • userPerm: Type: String Name of the user permission to check for runtime customer community user status.

Return Value

Type: Boolean

isRuntimeUser(orgId, userId, userPerm)

Checks whether the user has runtime user permissions (true) or not (false).

Signature

public static Boolean isRuntimeUser(String orgId, String userId, String userPerm)

Parameters

  • orgId: Type: String ID of the org.
  • userId: Type: String ID of the user.
  • userPerm: Type: String Name of the user permission to check for runtime user status.

Return Value

Type: Boolean