Пример #1
0
 public void SetUserRole(int profileId, int userRole)
 {
     if (_CheckRight(EUserRights.EditAllProfiles))
     {
         CVocaluxeServer.DoTaskWithoutReturn(CVocaluxeServer.SetUserRole, profileId, userRole);
     }
 }
Пример #2
0
        public void MoveSongInPlaylist(int newPosition, int playlistId, int songId)
        {
            if (!_CheckRight(EUserRights.ReorderPlaylists))
            {
                return;
            }

            try
            {
                CVocaluxeServer.DoTaskWithoutReturn(CVocaluxeServer.MoveSongInPlaylist, newPosition, playlistId, songId);
            }
            catch (ArgumentException e)
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingResponse.StatusCode        = HttpStatusCode.Forbidden;
                    WebOperationContext.Current.OutgoingResponse.StatusDescription = e.Message;
                }
            }
        }
Пример #3
0
        public void RemovePlaylist(int playlistId)
        {
            if (!_CheckRight(EUserRights.DeletePlaylists))
            {
                return;
            }

            try
            {
                CVocaluxeServer.DoTaskWithoutReturn(CVocaluxeServer.RemovePlaylist, playlistId);
            }
            catch (ArgumentException e)
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingResponse.StatusCode        = HttpStatusCode.Forbidden;
                    WebOperationContext.Current.OutgoingResponse.StatusDescription = e.Message;
                }
            }
        }
Пример #4
0
        public void AddSongToPlaylist(int songId, int playlistId, bool allowDuplicates)
        {
            if (!_CheckRight(EUserRights.AddSongToPlaylist))
            {
                return;
            }

            try
            {
                CVocaluxeServer.DoTaskWithoutReturn(CVocaluxeServer.AddSongToPlaylist, songId, playlistId, allowDuplicates);
            }
            catch (ArgumentException e)
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingResponse.StatusCode        = HttpStatusCode.Forbidden;
                    WebOperationContext.Current.OutgoingResponse.StatusDescription = e.Message;
                }
            }
        }