Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now

メニュー

Expand
Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

ロールとパーミッション

The Programmable Chat Permission model uses Roles and Permissions to enforce what Users and Members can do within a Service instance. These permissions are related to Channels, Members, and Messages. Roles and their associated permissions can be edited and extended on a per Service instance basis to meet the needs of different use cases.

目次

ロールおよびロールのスコープ

Chat Roles are divided into two "Scopes," Service and Channel. These determine how the Role permissions are applied depending on the context.

  • Service level Roles are assigned to Users and dictate which Channels the User can see, join, and create.
  • Channel level Roles are assigned to Members within a Channel. These roles determine what Members can do within that Channel, such as send Messages, add other Members, edit Messages and more.

Permissions are enforced at runtime based on the action being performed and whether the User/Member's Role has the required Permissions. If they do, the action is allowed and will be processed. If not, the action will be disallowed, and an error message will be returned to the requesting endpoint (usually a 403 Permission Denied error).

Note: Chat Service instances are created with a default set of Roles and Permissions. You can modify and extend these Roles and their assigned Permissions via the REST API.

デフォルトロールとパーミッション

When a new Chat Service instance is created, the following default Roles are created with the assigned set of Permissions:

ロール パーミッション
サービスアドミン
  • addMember
  • createChannel
  • deleteAnyMessage
  • destroyChannel
  • editAnyMessage
  • editAnyMessageAttributes
  • editAnyUserInfo
  • editChannelAttributes
  • editChannelName
  • inviteMember
  • joinChannel
  • removeMember
サービスユーザー(デフォルトのサービスユーザーロール)
  • createChannel
  • editOwnUserInfo
  • joinChannel
チャンネルアドミン
  • addMember
  • deleteAnyMessage
  • destroyChannel
  • editAnyMessage
  • editAnyMessageAttributes
  • editChannelAttributes
  • editChannelName
  • inviteMember
  • leaveChannel
  • removeMember
  • sendMediaMessage
  • sendMessage
チャンネルユーザー(デフォルトのチャンネルメンバーロール)
  • deleteOwnMessage
  • editOwnMessage
  • 独自のメッセージ属性を編集する
  • leaveChannel
  • sendMediaMessage
  • sendMessage

Manage Roles and Permissions

It is possible to manage Roles within a Service instance, create new ones, modify Permissions for a Role, and more via the Roles REST endpoint. You can find more information on how to do this in our Programmable Chat Roles REST Resource

Please note that we plan to add managing Roles to the Chat Console in the near future.

Note: While it is possible to delete the default Roles, it is not advisable, as any Users and Members created before the delete will reference the Default Role SIDs. Instead, modify these roles and reuse them, adding new Roles as needed.

Rate this page:

ヘルプが必要ですか?

誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。