Beispiel #1
0
        public Task DeleteChannelPermissions(string channelId, string userOrRoleId)
        {
            if (channelId == null)
            {
                throw new ArgumentNullException(nameof(channelId));
            }
            if (userOrRoleId == null)
            {
                throw new ArgumentNullException(nameof(userOrRoleId));
            }

            return(_rest.Delete(Endpoints.ChannelPermission(channelId, userOrRoleId), null));
        }
Beispiel #2
0
        //Permissions
        public Task SetChannelPermissions(string channelId, string userOrRoleId, string idType, uint allow = 0, uint deny = 0)
        {
            if (channelId == null)
            {
                throw new ArgumentNullException(nameof(channelId));
            }
            if (userOrRoleId == null)
            {
                throw new ArgumentNullException(nameof(userOrRoleId));
            }
            if (idType == null)
            {
                throw new ArgumentNullException(nameof(idType));
            }

            var request = new SetChannelPermissionsRequest {
                Id = userOrRoleId, Type = idType, Allow = allow, Deny = deny
            };

            return(_rest.Put(Endpoints.ChannelPermission(channelId, userOrRoleId), request));
        }