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.
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.
This method uses the global
access modifier.
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
.