tencent cloud

Tencent Cloud Super App as a Service

Customizing Authorization List

PDF
Focus Mode
Font Size
Last updated: 2025-07-04 17:33:32
Certain APIs involve user privacy, and the Super App as a Service (SAS) enforces authorization controls for them. Users can choose whether to grant permissions based on their preferences. This document covers customization requirements for the permission list.

Get the mini program permission list

You can get the permission list for a specified mini program by calling TmfMiniSDK.getAuthStateList, which only supports calls from the mini program process.
/**
* Gets the mini program permission list
* @param appID - Mini program appid
* @param appVerType - Mini program version type
* @return
*/
public static List<MiniAuthState> getAuthStateList(String appId, int appVerType)

Set permission status for the mini program

Call tmfMiniSDK.setAuthState to set the authorization status for a specified mini program.
/**
* Sets the authorization status. It is supported in the mini program process.
*
* @param appID - Mini program appid
* @param appVerType - Mini program version type
* @param scopeName - Permission name
* @param grant - Whether to authorize
*/
public static void setAuthState(String appId, int appVerType, String scopeName, boolean grant)

Customize mini program permission description

Implement IScopeInfoProxy to customize the permission list information.
public interface IScopeInfoProxy {
/**
* Returns the permission list information that needs to be customized
* @return
*/
List<PermissionInfo> getScopeInfos();
}
For mini program permission list, refer to Scope list
Example:
@ProxyService(proxy = IScopeInfoProxy.class)
public class ScopeInfoProxyImpl implements IScopeInfoProxy {
@Override
public List<PermissionInfo> getScopeInfos() {
// You can modify Scope information, such as name and description
ArrayList<PermissionInfo> perms = new ArrayList<>();
PermissionInfo userInfo = new PermissionInfo();
// Permission ID
userInfo.id = "scope.userInfo";
// Permission name and title
userInfo.name = "Get your nickname and profile photo";
// Permission description
userInfo.description = "Get personal information to provide personalized services";
// Permission denied text
userInfo.rejectDescription = "Deny";
// The title displayed in the permission settings page
userInfo.settingPageTitle = "User information";
perms.add(userInfo);
return perms;
}
}




Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback