Пример #1
0
        protected void ReceiveRequestAddGroupToUser(PacketHeader header, Connection connection, GroupRequest request)
        {
            // ########################################################################
            // This method requires authentication.
            // If user is not authorized then send UnAuthorized and end method.
            if (!Authorized(connection))
            {
                TCPConnection.GetConnection(connection.ConnectionInfo).SendObject(
                    PacketName.ReUnauthorized.ToString(), 1);

                return;
            }
            // ########################################################################

            if (Administrator(connection))
            {
                groupRepository.AddAccess(request.accountId, request.groupId);

                TCPConnection.GetConnection(connection.ConnectionInfo).SendObject(
                    PacketName.ReAddGroupToUser.ToString(), GenericResponse.Success);
            }
        }