deriveUserRoleV2

Function

Derives the user role for the given channel and user

Parameters

Parameter Type Default Notes
channel Required IChannel

an IChannel object

user Optional IUser | IDiscussionsUser {}

An IUser or IDiscussionUser object

Returns

the appropriate Role for the given user relative to the given channel

Property Type Notes
MANAGE "manage"
MODERATE "moderate"
OWNER "owner"
READ "read"
READWRITE "readWrite"
WRITE "write"

Function defined in common/src/discussions/api/utils/channels/derive-user-role-v2.ts:11