Asset Access

Apex SDK for Slack restricts access to assets using access check validation. Assets include your Slack app definitions, view definitions, actions, and data providers.

Your assets are retrieved from the database on-demand with their associated metadata. It validates that a reference to an asset from another asset is valid. It checks that an asset has access to the asset it’s referencing. For example, the framework validates that a component in the c namespace can reference an action in mynamespace and vice versa.

Restrict Access to Assets 

Access to an Apex action or data provider is based on access modifiers on your Apex methods. You can’t set the access based on metadata.

Only public and global access modifiers are supported.

  • public- Your Apex action or data provider can be referenced from the same namespace.
  • global- Your Apex action or data provider can be referenced from the same or different namespace.

This example class uses the public access modifier.

1public class AppHomeOpened extends Slack.EventDispatcher { }

This method uses the global access modifier.

1global static String echo(String echoStr) { }

Asset Access Considerations 

Invalid use cases can prevent your app or view from being saved correctly. Consider these guidelines when working with Apex SDK for Slack assets.

An app definition (.slackapp) references an Apex action using the apex__action__ClassName or apex__action__Namespace.ClassName format. Let’s say that NamespaceA.ClassName is public. If your app is in NamespaceB, it cannot reference NamespaceA.ClassName.

A view definition references a data provider using the apex__MyClassName.getMyMethodName or apex__MyNamespace.MyClassName format. Let’s say that NamespaceA.ClassName is public. If your view definition is in NamespaceB, it cannot reference NamespaceA.ClassName.

See Also 

Beta Feature

This feature is not generally available. It is not part of your purchased Services. This feature is subject to change, may be discontinued with no notice at any time in SFDC’s sole discretion, and SFDC may never make this feature generally available. Make your purchase decisions only on the basis of generally available products and features. This feature is made available on an AS IS basis and use of this feature is at your sole risk.