Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 4.46 KB

app-permission-system.md

File metadata and controls

41 lines (29 loc) · 4.46 KB

App Permission System

Each feature available in the Apps-Engine is mapped to a permission. Adding the permission in the app's manifest (app.json file) will unlock said feature to be used by the app. For example, if you add the send messages permission to your app's manifest, your app can send messages in the Rocket.Chat server. If your app tries to send a message without having the send messages permission listed in the manifest, Apps-Engine will block the feature and the app will not be able to perform the desired action.

When installing an app, be it via the Marketplace or installing it manually via zip file, a window asks the user to review the permissions that the app requires to work properly. The user installing the app can either accept and install the app or deny the permissions and not install it.

Add permissions to your app

In your app's manifest file (app.json), add the field permissions. It receives a list containing all the permissions that you are asking for. For example:

{
...
"permissions": [
    {
        "name": "user.read"
    },
    {
        "name": "user.write"
    },
    {
        "name": "upload.read"
    },
  ],
...
}

Notice about rule enforcement

Currently, the Apps-Engine does not enforce the use of the permissions to make your apps work, meaning your current apps (including those published on the Marketplace) will still work as expected. All the apps that do not have the permissions listed in their manifest will still have access to all the features they need through default permissions. They are applied to your app automatically when no permissions property is found in the app's manifest.

Until the sunsetting period for the "permissionless engine" is not defined, setting permissions in your app's manifest will be optional.

List of permissions

Here is a list of the available permissions:

Permission NameDescription
user.readAccess user information
user.writeModify user information
upload.readAccess files uploaded to the server
upload.writeUpload files to the server
server-setting.readAccess settings in the server
server-setting.writeModify settings in the server
room.readAccess room information
room.writeCreate and modify rooms
message.readAccess messages
message.writeSend and modify messages
livechat-status.readAccess Livechat status information
livechat-custom-fields.writeModify Livechat custom field configuration
livechat-visitor.readAccess Livechat visitor information
livechat-visitor.writeModify Livechat visitor information
livechat-message.readAccess Livechat message information
livechat-message.writeModify Livechat message information
livechat-room.readAccess Livechat room information
livechat-room.writeModify Livechat room information
livechat-department.readAccess Livechat department information
livechat-department.writeModify Livechat department information
slashcommandRegister new slash commands
apisRegister new HTTP endpoints
env.readAccess minimal information about the server environment
networkingAccess to the server network
persistenceStore internal data in the database
schedulerRegister and maintain scheduled jobs
ui.interactInteract with the UI (UIKit)

Once an app is on the Rocket.Chat workspace, it goes through several lifecycle phases unique to Rocket.Chat. The phases depend on the capabilities that your app has. To learn about the app lifecycle, head over to the next page.